Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

96 righe
2.8 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2009 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_CONVERTER_H__
  26. #define __G_CONVERTER_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_CONVERTER (g_converter_get_type ())
  30. #define G_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_CONVERTER, GConverter))
  31. #define G_IS_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_CONVERTER))
  32. #define G_CONVERTER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_CONVERTER, GConverterIface))
  33. /**
  34. * GConverter:
  35. *
  36. * Seek object for streaming operations.
  37. *
  38. * Since: 2.24
  39. **/
  40. typedef struct _GConverterIface GConverterIface;
  41. /**
  42. * GConverterIface:
  43. * @g_iface: The parent interface.
  44. * @convert: Converts data.
  45. * @reset: Reverts the internal state of the converter to its initial state.
  46. *
  47. * Provides an interface for converting data from one type
  48. * to another type. The conversion can be stateful
  49. * and may fail at any place.
  50. *
  51. * Since: 2.24
  52. **/
  53. struct _GConverterIface
  54. {
  55. GTypeInterface g_iface;
  56. /* Virtual Table */
  57. GConverterResult (* convert) (GConverter *converter,
  58. const void *inbuf,
  59. gsize inbuf_size,
  60. void *outbuf,
  61. gsize outbuf_size,
  62. GConverterFlags flags,
  63. gsize *bytes_read,
  64. gsize *bytes_written,
  65. GError **error);
  66. void (* reset) (GConverter *converter);
  67. };
  68. GType g_converter_get_type (void) G_GNUC_CONST;
  69. GConverterResult g_converter_convert (GConverter *converter,
  70. const void *inbuf,
  71. gsize inbuf_size,
  72. void *outbuf,
  73. gsize outbuf_size,
  74. GConverterFlags flags,
  75. gsize *bytes_read,
  76. gsize *bytes_written,
  77. GError **error);
  78. void g_converter_reset (GConverter *converter);
  79. G_END_DECLS
  80. #endif /* __G_CONVERTER_H__ */