gdatainputstream.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General
  18. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #ifndef __G_DATA_INPUT_STREAM_H__
  23. #define __G_DATA_INPUT_STREAM_H__
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #include <gio/gbufferedinputstream.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_DATA_INPUT_STREAM (g_data_input_stream_get_type ())
  30. #define G_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStream))
  31. #define G_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
  32. #define G_IS_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DATA_INPUT_STREAM))
  33. #define G_IS_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DATA_INPUT_STREAM))
  34. #define G_DATA_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
  35. typedef struct _GDataInputStreamClass GDataInputStreamClass;
  36. typedef struct _GDataInputStreamPrivate GDataInputStreamPrivate;
  37. struct _GDataInputStream
  38. {
  39. GBufferedInputStream parent_instance;
  40. /*< private >*/
  41. GDataInputStreamPrivate *priv;
  42. };
  43. struct _GDataInputStreamClass
  44. {
  45. GBufferedInputStreamClass parent_class;
  46. /*< private >*/
  47. /* Padding for future expansion */
  48. void (*_g_reserved1) (void);
  49. void (*_g_reserved2) (void);
  50. void (*_g_reserved3) (void);
  51. void (*_g_reserved4) (void);
  52. void (*_g_reserved5) (void);
  53. };
  54. GIO_AVAILABLE_IN_ALL
  55. GType g_data_input_stream_get_type (void) G_GNUC_CONST;
  56. GIO_AVAILABLE_IN_ALL
  57. GDataInputStream * g_data_input_stream_new (GInputStream *base_stream);
  58. GIO_AVAILABLE_IN_ALL
  59. void g_data_input_stream_set_byte_order (GDataInputStream *stream,
  60. GDataStreamByteOrder order);
  61. GIO_AVAILABLE_IN_ALL
  62. GDataStreamByteOrder g_data_input_stream_get_byte_order (GDataInputStream *stream);
  63. GIO_AVAILABLE_IN_ALL
  64. void g_data_input_stream_set_newline_type (GDataInputStream *stream,
  65. GDataStreamNewlineType type);
  66. GIO_AVAILABLE_IN_ALL
  67. GDataStreamNewlineType g_data_input_stream_get_newline_type (GDataInputStream *stream);
  68. GIO_AVAILABLE_IN_ALL
  69. guchar g_data_input_stream_read_byte (GDataInputStream *stream,
  70. GCancellable *cancellable,
  71. GError **error);
  72. GIO_AVAILABLE_IN_ALL
  73. gint16 g_data_input_stream_read_int16 (GDataInputStream *stream,
  74. GCancellable *cancellable,
  75. GError **error);
  76. GIO_AVAILABLE_IN_ALL
  77. guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream,
  78. GCancellable *cancellable,
  79. GError **error);
  80. GIO_AVAILABLE_IN_ALL
  81. gint32 g_data_input_stream_read_int32 (GDataInputStream *stream,
  82. GCancellable *cancellable,
  83. GError **error);
  84. GIO_AVAILABLE_IN_ALL
  85. guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream,
  86. GCancellable *cancellable,
  87. GError **error);
  88. GIO_AVAILABLE_IN_ALL
  89. gint64 g_data_input_stream_read_int64 (GDataInputStream *stream,
  90. GCancellable *cancellable,
  91. GError **error);
  92. GIO_AVAILABLE_IN_ALL
  93. guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream,
  94. GCancellable *cancellable,
  95. GError **error);
  96. GIO_AVAILABLE_IN_ALL
  97. char * g_data_input_stream_read_line (GDataInputStream *stream,
  98. gsize *length,
  99. GCancellable *cancellable,
  100. GError **error);
  101. GIO_AVAILABLE_IN_2_30
  102. char * g_data_input_stream_read_line_utf8 (GDataInputStream *stream,
  103. gsize *length,
  104. GCancellable *cancellable,
  105. GError **error);
  106. GIO_AVAILABLE_IN_ALL
  107. void g_data_input_stream_read_line_async (GDataInputStream *stream,
  108. gint io_priority,
  109. GCancellable *cancellable,
  110. GAsyncReadyCallback callback,
  111. gpointer user_data);
  112. GIO_AVAILABLE_IN_ALL
  113. char * g_data_input_stream_read_line_finish (GDataInputStream *stream,
  114. GAsyncResult *result,
  115. gsize *length,
  116. GError **error);
  117. GIO_AVAILABLE_IN_2_30
  118. char * g_data_input_stream_read_line_finish_utf8(GDataInputStream *stream,
  119. GAsyncResult *result,
  120. gsize *length,
  121. GError **error);
  122. GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto)
  123. char * g_data_input_stream_read_until (GDataInputStream *stream,
  124. const gchar *stop_chars,
  125. gsize *length,
  126. GCancellable *cancellable,
  127. GError **error);
  128. GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_async)
  129. void g_data_input_stream_read_until_async (GDataInputStream *stream,
  130. const gchar *stop_chars,
  131. gint io_priority,
  132. GCancellable *cancellable,
  133. GAsyncReadyCallback callback,
  134. gpointer user_data);
  135. GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_finish)
  136. char * g_data_input_stream_read_until_finish (GDataInputStream *stream,
  137. GAsyncResult *result,
  138. gsize *length,
  139. GError **error);
  140. GIO_AVAILABLE_IN_ALL
  141. char * g_data_input_stream_read_upto (GDataInputStream *stream,
  142. const gchar *stop_chars,
  143. gssize stop_chars_len,
  144. gsize *length,
  145. GCancellable *cancellable,
  146. GError **error);
  147. GIO_AVAILABLE_IN_ALL
  148. void g_data_input_stream_read_upto_async (GDataInputStream *stream,
  149. const gchar *stop_chars,
  150. gssize stop_chars_len,
  151. gint io_priority,
  152. GCancellable *cancellable,
  153. GAsyncReadyCallback callback,
  154. gpointer user_data);
  155. GIO_AVAILABLE_IN_ALL
  156. char * g_data_input_stream_read_upto_finish (GDataInputStream *stream,
  157. GAsyncResult *result,
  158. gsize *length,
  159. GError **error);
  160. G_END_DECLS
  161. #endif /* __G_DATA_INPUT_STREAM_H__ */