Top |
The data output stream used by CTPL; built on top of GOutputStream.
A CtplOutputStream is created with ctpl_output_stream_new()
. It uses a
GObject-like refcounting, through ctpl_output_stream_ref()
and
ctpl_output_stream_unref()
.
The errors that the functions in this module can throw comes from the
G_IO_ERROR
or CTPL_IO_ERROR
domains unless otherwise mentioned.
CtplOutputStream *
ctpl_output_stream_new (GOutputStream *stream
);
Creates a new CtplOutputStream for a given GOutputStream. This function adds a reference to the GOutputStream.
Since 0.2
CtplOutputStream *
ctpl_output_stream_ref (CtplOutputStream *stream
);
Adds a reference to a CtplOutputStream.
Since 0.2
void
ctpl_output_stream_unref (CtplOutputStream *stream
);
Removes a reference from a CtplOutputStream. When its reference count reaches 0, the stream is destroyed.
Since 0.2
GOutputStream *
ctpl_output_stream_get_stream (CtplOutputStream *stream
);
Gets the underlying GOutputStream associated with a CtplOutputStream.
Since 0.3
gboolean ctpl_output_stream_write (CtplOutputStream *stream
,const gchar *data
,gssize length
,GError **error
);
Writes a buffer to a CtplOutputStream.
stream |
||
data |
The data to write |
|
length |
Length of the data in bytes, or -1 if it is a 0-terminated string |
|
error |
Return location for errors, or |
Since 0.2
gboolean ctpl_output_stream_put_c (CtplOutputStream *stream
,gchar c
,GError **error
);
Writes a character to a CtplOutputStream.
Since 0.2