GMime 2.4 Reference Manual | ||||
---|---|---|---|---|
GMimeDataWrapper; GMimeDataWrapper* g_mime_data_wrapper_new (void); GMimeDataWrapper* g_mime_data_wrapper_new_with_stream (GMimeStream *stream, GMimeContentEncoding encoding); void g_mime_data_wrapper_set_stream (GMimeDataWrapper *wrapper, GMimeStream *stream); GMimeStream* g_mime_data_wrapper_get_stream (GMimeDataWrapper *wrapper); void g_mime_data_wrapper_set_encoding (GMimeDataWrapper *wrapper, GMimeContentEncoding encoding); GMimeContentEncoding g_mime_data_wrapper_get_encoding (GMimeDataWrapper *wrapper); ssize_t g_mime_data_wrapper_write_to_stream (GMimeDataWrapper *wrapper, GMimeStream *stream);
A GMimeDataWrapper is a wrapper object for a GMimePart's body, allowing clients to read the content from the backing stream without having to know whether it is encoded/compressed/etc and not neding to know how to undo said encoding(s).
typedef struct _GMimeDataWrapper GMimeDataWrapper;
A wrapper for a stream which may be encoded.
GMimeDataWrapper* g_mime_data_wrapper_new (void);
Creates a new GMimeDataWrapper object.
Returns : |
a new data wrapper object. |
GMimeDataWrapper* g_mime_data_wrapper_new_with_stream (GMimeStream *stream, GMimeContentEncoding encoding);
Creates a new GMimeDataWrapper object around stream
.
|
a GMimeStream |
|
stream's encoding |
Returns : |
a data wrapper around stream . Since the wrapper owns its
own reference on the stream, caller is responsible for unrefing
its own copy.
|
void g_mime_data_wrapper_set_stream (GMimeDataWrapper *wrapper, GMimeStream *stream);
Replaces the wrapper's internal stream with stream
. Don't forget,
if stream
is not of the same encoding as the old stream, you'll
want to call g_mime_data_wrapper_set_encoding()
as well.
Note: caller is responsible for its own reference on
stream
.
|
a GMimeDataWrapper |
|
a GMimeStream |
GMimeStream* g_mime_data_wrapper_get_stream (GMimeDataWrapper *wrapper);
Gets a reference to the stream wrapped by wrapper
.
|
a GMimeDataWrapper |
Returns : |
a reference to the internal stream. Caller is responsible for unrefing it. |
void g_mime_data_wrapper_set_encoding (GMimeDataWrapper *wrapper, GMimeContentEncoding encoding);
Sets the encoding type of the internal stream.
|
a GMimeDataWrapper |
|
encoding |
GMimeContentEncoding g_mime_data_wrapper_get_encoding (GMimeDataWrapper *wrapper);
Gets the encoding type of the stream wrapped by wrapper
.
|
a GMimeDataWrapper |
Returns : |
the encoding type of the internal stream. |
ssize_t g_mime_data_wrapper_write_to_stream (GMimeDataWrapper *wrapper, GMimeStream *stream);
Writes the raw (decoded) data to the output stream.
|
a GMimeDataWrapper |
|
output stream |
Returns : |
the number of bytes written or -1 on failure.
|