Class
CamelStream
Description [src]
class Camel.Stream : GObject.Object
implements Gio.Seekable {
CamelStreamPrivate* priv
}
Abstract base class for I/O streams.
CamelStream is an abstract base class that implements a simple read/write
stream interface. It is used throughout Camel for I/O abstraction, allowing
the same message handling code to work with files, sockets, memory buffers,
and more.
The stream hierarchy includes:
-
CamelStreamBuffer— provides line-buffering on top of another stream, including a convenientcamel_stream_buffer_read_line()function. -
CamelStreamFilter— a sophisticated stream that runs data through a chain ofCamelMimeFilterinstances for efficient pipelined processing. -
CamelStreamFs— a file-descriptor-backed stream. -
CamelStreamMem— a memory-backed stream backed by aGByteArray. -
CamelStreamNull— a null stream that discards all output; useful for measuring encoded output size. -
CamelStreamProcess— a stream backed by a child process.
Utility functions such as camel_stream_write_string() and
camel_stream_write_to_stream() are provided for common operations.
Instance methods
camel_stream_flush
Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams.
camel_stream_ref_base_stream
Returns the GIOStream for stream. This is only valid if stream was
created with camel_stream_new(). For all other CamelStream subclasses
this function returns NULL.
since: 3.12
camel_stream_set_base_stream
Replaces the GIOStream passed to camel_stream_new() with base_stream.
The new base_stream should wrap the original GIOStream, such as when
adding Transport Layer Security after issuing a STARTTLS command.
since: 3.12
camel_stream_write_to_stream
Write all of a stream (until eos) into another stream, in a blocking fashion.
Methods inherited from GSeekable (5)
g_seekable_can_seek
Tests if the stream supports the GSeekableIface.
g_seekable_can_truncate
Tests if the length of the stream can be adjusted with g_seekable_truncate().
g_seekable_seek
Seeks in the stream by the given offset, modified by type.
g_seekable_tell
Tells the current position within the stream.
g_seekable_truncate
Sets the length of the stream to offset. If the stream was previously
larger than offset, the extra data is discarded. If the stream was
previously shorter than offset, it is extended with NUL (‘\0’) bytes.
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct CamelStreamClass {
GObjectClass parent_class;
gssize (* read) (
CamelStream* stream,
gchar* buffer,
gsize n,
GCancellable* cancellable,
GError** error
);
gssize (* write) (
CamelStream* stream,
const gchar* buffer,
gsize n,
GCancellable* cancellable,
GError** error
);
gint (* close) (
CamelStream* stream,
GCancellable* cancellable,
GError** error
);
gint (* flush) (
CamelStream* stream,
GCancellable* cancellable,
GError** error
);
gboolean (* eos) (
CamelStream* stream
);
gpointer reserved;
}
No description available.
Class members
parent_class: GObjectClassNo description available.
read: gssize (* read) ( CamelStream* stream, gchar* buffer, gsize n, GCancellable* cancellable, GError** error )No description available.
write: gssize (* write) ( CamelStream* stream, const gchar* buffer, gsize n, GCancellable* cancellable, GError** error )No description available.
close: gint (* close) ( CamelStream* stream, GCancellable* cancellable, GError** error )No description available.
flush: gint (* flush) ( CamelStream* stream, GCancellable* cancellable, GError** error )No description available.
eos: gboolean (* eos) ( CamelStream* stream )No description available.
reserved: gpointerNo description available.
Virtual methods
Camel.StreamClass.flush
Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams.