[gnio] Add more GIOStream docs



commit 84516a5f544d8d5f3da368a83844e84eca8ef771
Author: Alexander Larsson <alexl redhat com>
Date:   Tue May 12 15:08:02 2009 +0200

    Add more GIOStream docs
---
 gio/giostream.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/gio/giostream.c b/gio/giostream.c
index 0b00eff..90f74e4 100644
--- a/gio/giostream.c
+++ b/gio/giostream.c
@@ -29,6 +29,27 @@
 
 G_DEFINE_TYPE (GIOStream, g_io_stream, G_TYPE_OBJECT);
 
+/**
+ * SECTION:ginputstream
+ * @short_description: Base class for implementing readwrite streams
+ * @include: gio/gio.h
+ *
+ * GIOStream represents an object that has both read and write streams.
+ * Generally the two streams acts as separate input and output streams,
+ * but they share some common resources and state. For instance, for
+ * seekable streams they may use the same position in both streams.
+ *
+ * To do the actual reading and writing you need to get the substreams
+ * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
+ *
+ * To close a stream use g_io_stream_close() which will close the common
+ * stream object and also the individual substreams. You can also close
+ * the substreams themselves. In most cases this only marks the
+ * substream as closed, so further I/O on it fails. However, some streams
+ * may support "half-closed" states where one direction of the stream
+ * is actually shut down.
+ **/
+
 enum
 {
   PROP_0,
@@ -166,6 +187,15 @@ g_io_stream_class_init (GIOStreamClass *klass)
 							G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 }
 
+/**
+ * g_io_stream_get_input_stream:
+ * @stream: input #GIOStream.
+ *
+ * Gets the input stream for this object. This is used
+ * for reading.
+ *
+ * Returns: a #GInputStream, owned by the #GIOStream do not free.
+ **/
 GInputStream *
 g_io_stream_get_input_stream (GIOStream *io_stream)
 {
@@ -178,6 +208,15 @@ g_io_stream_get_input_stream (GIOStream *io_stream)
   return klass->get_input_stream (io_stream);
 }
 
+/**
+ * g_io_stream_get_output_stream:
+ * @stream: input #GIOStream.
+ *
+ * Gets the output stream for this object. This is used for
+ * writing.
+ *
+ * Returns: a #GOutputStream, owned by the #GIOStream do not free.
+ **/
 GOutputStream *
 g_io_stream_get_output_stream (GIOStream *io_stream)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]