1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * SPDX-License-Identifier: LGPL-2.1-or-later
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.
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.
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/>.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #ifndef __G_DATA_INPUT_STREAM_H__
24 #define __G_DATA_INPUT_STREAM_H__
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
30 #include <gio/gbufferedinputstream.h>
34 #define G_TYPE_DATA_INPUT_STREAM (g_data_input_stream_get_type ())
35 #define G_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStream))
36 #define G_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
37 #define G_IS_DATA_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DATA_INPUT_STREAM))
38 #define G_IS_DATA_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DATA_INPUT_STREAM))
39 #define G_DATA_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
41 typedef struct _GDataInputStreamClass GDataInputStreamClass;
42 typedef struct _GDataInputStreamPrivate GDataInputStreamPrivate;
44 struct _GDataInputStream
46 GBufferedInputStream parent_instance;
49 GDataInputStreamPrivate *priv;
52 struct _GDataInputStreamClass
54 GBufferedInputStreamClass parent_class;
57 /* Padding for future expansion */
58 void (*_g_reserved1) (void);
59 void (*_g_reserved2) (void);
60 void (*_g_reserved3) (void);
61 void (*_g_reserved4) (void);
62 void (*_g_reserved5) (void);
66 GType g_data_input_stream_get_type (void) G_GNUC_CONST;
68 GDataInputStream * g_data_input_stream_new (GInputStream *base_stream);
71 void g_data_input_stream_set_byte_order (GDataInputStream *stream,
72 GDataStreamByteOrder order);
74 GDataStreamByteOrder g_data_input_stream_get_byte_order (GDataInputStream *stream);
76 void g_data_input_stream_set_newline_type (GDataInputStream *stream,
77 GDataStreamNewlineType type);
79 GDataStreamNewlineType g_data_input_stream_get_newline_type (GDataInputStream *stream);
81 guchar g_data_input_stream_read_byte (GDataInputStream *stream,
82 GCancellable *cancellable,
85 gint16 g_data_input_stream_read_int16 (GDataInputStream *stream,
86 GCancellable *cancellable,
89 guint16 g_data_input_stream_read_uint16 (GDataInputStream *stream,
90 GCancellable *cancellable,
93 gint32 g_data_input_stream_read_int32 (GDataInputStream *stream,
94 GCancellable *cancellable,
97 guint32 g_data_input_stream_read_uint32 (GDataInputStream *stream,
98 GCancellable *cancellable,
101 gint64 g_data_input_stream_read_int64 (GDataInputStream *stream,
102 GCancellable *cancellable,
105 guint64 g_data_input_stream_read_uint64 (GDataInputStream *stream,
106 GCancellable *cancellable,
109 char * g_data_input_stream_read_line (GDataInputStream *stream,
111 GCancellable *cancellable,
113 GIO_AVAILABLE_IN_2_30
114 char * g_data_input_stream_read_line_utf8 (GDataInputStream *stream,
116 GCancellable *cancellable,
119 void g_data_input_stream_read_line_async (GDataInputStream *stream,
121 GCancellable *cancellable,
122 GAsyncReadyCallback callback,
125 char * g_data_input_stream_read_line_finish (GDataInputStream *stream,
126 GAsyncResult *result,
129 GIO_AVAILABLE_IN_2_30
130 char * g_data_input_stream_read_line_finish_utf8(GDataInputStream *stream,
131 GAsyncResult *result,
134 GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto)
135 char * g_data_input_stream_read_until (GDataInputStream *stream,
136 const gchar *stop_chars,
138 GCancellable *cancellable,
140 GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_async)
141 void g_data_input_stream_read_until_async (GDataInputStream *stream,
142 const gchar *stop_chars,
144 GCancellable *cancellable,
145 GAsyncReadyCallback callback,
147 GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_finish)
148 char * g_data_input_stream_read_until_finish (GDataInputStream *stream,
149 GAsyncResult *result,
154 char * g_data_input_stream_read_upto (GDataInputStream *stream,
155 const gchar *stop_chars,
156 gssize stop_chars_len,
158 GCancellable *cancellable,
161 void g_data_input_stream_read_upto_async (GDataInputStream *stream,
162 const gchar *stop_chars,
163 gssize stop_chars_len,
165 GCancellable *cancellable,
166 GAsyncReadyCallback callback,
169 char * g_data_input_stream_read_upto_finish (GDataInputStream *stream,
170 GAsyncResult *result,
176 #endif /* __G_DATA_INPUT_STREAM_H__ */