| Top |
| GMimeStream * | g_mime_stream_gio_new () |
| GMimeStream * | g_mime_stream_gio_new_with_bounds () |
| gboolean | g_mime_stream_gio_get_owner () |
| void | g_mime_stream_gio_set_owner () |
A simple GMimeStream implementation that sits on top of GLib's GIO input and output streams.
Constructors take ownership of the supplied GFile reference. The owner flag controls releasing that reference, not closing the input/output streams opened by this wrapper. Explicit close attempts both streams and reports the first error through errno, even though the wrapper is closed afterward. Finalization releases resources but cannot report close failures.
GMimeStream *
g_mime_stream_gio_new (GFile *file);
Creates a new GMimeStreamGIO wrapper around a GFile object.
Pass an additional reference if the caller also needs to retain file
.
GMimeStream * g_mime_stream_gio_new_with_bounds (GFile *file,gint64 start,gint64 end);
Creates a new GMimeStreamGIO stream around a GFile with bounds
start
and end
. Pass an additional reference if the caller also needs
to retain file
.
file |
a GFile reference to take ownership of. |
[transfer full] |
start |
start boundary |
|
end |
end boundary |
gboolean
g_mime_stream_gio_get_owner (GMimeStreamGIO *stream);
Gets whether or not stream
owns the backend GFile.
void g_mime_stream_gio_set_owner (GMimeStreamGIO *stream,gboolean owner);
Sets whether close or finalization releases the supplied GFile reference. Changing this flag does not acquire or release a reference immediately.
With owner
set to FALSE, the caller must keep the GFile alive and release
its reference after the wrapper is no longer needed. Input and output
streams opened by the wrapper are always closed and released, regardless
of this flag. Substreams borrow the parent's GFile; do not explicitly
close an owning parent while its substreams still need it.
stream |
a GMimeStreamGIO stream |
|
owner |
|
typedef struct _GMimeStreamGIO GMimeStreamGIO;
A GMimeStream wrapper around GLib's GIO streams.