Top |
Functions
GMimeStream * | g_mime_stream_buffer_new () |
ssize_t | g_mime_stream_buffer_gets () |
void | g_mime_stream_buffer_readln () |
Description
A GMimeStreamBuffer can be used on top of any other type of stream and has 3 modes: block reads, block writes, and cached reads. Block reads are especially useful if you will be making a lot of small reads from a stream that accesses the file system. Block writes are useful for very much the same reason. The final mode, cached reads, can become memory intensive but can be very helpful when inheriting from a stream that does not support seeking (Note: this mode is the least tested so be careful using it).
Functions
g_mime_stream_buffer_new ()
GMimeStream * g_mime_stream_buffer_new (GMimeStream *source
,GMimeStreamBufferMode mode
);
Creates a new GMimeStreamBuffer object.
g_mime_stream_buffer_gets ()
ssize_t g_mime_stream_buffer_gets (GMimeStream *stream
,char *buf
,size_t max
);
Reads in at most one less than max
characters from stream
and
stores them into the buffer pointed to by buf
. Reading stops after
an EOS or newline ('\n'). If a newline is read, it is stored into
the buffer. A '\0' is stored after the last character in the
buffer.
g_mime_stream_buffer_readln ()
void g_mime_stream_buffer_readln (GMimeStream *stream
,GByteArray *buffer
);
Reads a single line into buffer
.
Types and Values
struct GMimeStreamBuffer
struct GMimeStreamBuffer;
A buffered stream wrapper around any GMimeStream object.