MimeFilter
Object Hierarchy:
Description:
[
CCode ( type_id =
"camel_mime_filter_get_type ()" ) ]
public abstract class MimeFilter :
Object
Stream-processing filter modules for MIME data.
MimeFilter is an abstract base class for stream-processing modules that transform blocks of data.
Filters can be used in three ways:
- **Individually** — call filter and
complete directly to process data buffers.
- **Attached to a stream** — add to a StreamFilter so that data read from or
written to the stream is automatically transformed.
- **Attached to a parser** — register with MimeParser for pipelined decoding while
a message is being parsed.
Each concrete filter subclass implements three virtual methods: filter, complete, and reset. The
base class handles all memory management for the pre-space / look-back buffer mechanism, which allows efficient multi-stage pipelined
processing.
Available filter implementations include character-set conversion (MimeFilterCharset
), base64 and quoted-printable encoding (MimeFilterBasic), line-ending
canonicalisation (MimeFilterCRLF), gzip compression (
MimeFilterGZip), HTML conversion (CamelMimeFilterToHtml), From-line
escaping (MimeFilterFrom), and many others.
Content:
Static methods:
Creation methods:
Methods:
- public void backup (uint8[] data)
Saves data to be used as prespace input data to the next
call to filter or
complete.
- public virtual void complete (uint8[] @in, size_t prespace, out uint8[] @out, out size_t outprespace)
Passes the input buffer, in, through
this and generates an output buffer, out and makes sure that all data is flushed to the
output buffer.
- public virtual void filter (uint8[] @in, size_t prespace, out uint8[] @out, out size_t outprespace)
Passes the input buffer, in, through
this and generates an output buffer, out.
- public bool get_request_stop ()
Returns whether the this requested
stop further processing with set_request_stop.
- public virtual void reset ()
Resets the state on this so that it
may be used again.
- public void set_request_stop (bool request_stop)
Sets whether the this requests, or
not, stop further processing.
- public void set_size (size_t size, int keep)
Ensure that this has enough storage
space to store size bytes for filter output.
Fields:
Inherited Members:
All known members inherited from class GLib.Object