| Top |
| GMimeStream * | g_mime_stream_filter_new () |
| int | g_mime_stream_filter_add () |
| void | g_mime_stream_filter_remove () |
| gboolean | g_mime_stream_filter_get_owner () |
| void | g_mime_stream_filter_set_owner () |
A GMimeStream meant for filtering data passing through it.
This stream class is useful for converting data of one type to another using GMimeFilter objects.
When data passes through a GMimeStreamFilter, it will pass through GMimeFilter filters in the order they were added.
Flushing completes the write-side filters once until more input is written. Unwritten completion output is retained if the source fails, so flushing or closing again can retry it without completing the filters twice. Closing reports these errors before closing an owned source. Flush does not flush the source stream itself.
Reading completes the filters once at end-of-stream and drains their final output before reporting EOF. Reset discards buffered output and filter state and starts a fresh conversion at the source's reset position. Do not manipulate filters or the source while output is buffered.
GMimeStream *
g_mime_stream_filter_new (GMimeStream *stream);
Creates a new GMimeStreamFilter object using stream
as the source
stream.
int g_mime_stream_filter_add (GMimeStreamFilter *stream,GMimeFilter *filter);
Adds filter
to stream
. Filters are applied in the same order in
which they are added. The same filter can be added more than once;
each occurrence retains its own reference.
void g_mime_stream_filter_remove (GMimeStreamFilter *stream,int id);
Removes a filter from the stream based on the id returned from
g_mime_stream_filter_add(). Other occurrences of the same filter are
unaffected. An unknown id does nothing.
Do not modify the chain while filtered output is buffered.
gboolean
g_mime_stream_filter_get_owner (GMimeStreamFilter *stream);
Gets whether or not stream
owns the source stream.
void g_mime_stream_filter_set_owner (GMimeStreamFilter *stream,gboolean owner);
Sets whether or not stream
owns the source stream..
Note: owner
should be TRUE if explicitly closing the stream should
close its source, or FALSE to leave the source open. Finalization
does not complete the filters or explicitly close the source.
typedef struct _GMimeStreamFilter GMimeStreamFilter;
A GMimeStream which passes data through any GMimeFilter objects.