Camel.MimeFilter
Description: Reference for Camel.MimeFilter

### Class

# CamelMimeFilter

#### Description [src]

    abstract class Camel.MimeFilter : GObject.Object
    {
      CamelMimeFilterPrivate* priv,
      gchar* outreal,
      gchar* outbuf,
      gchar* outptr,
      gsize outsize,
      gsize outpre,
      gchar* backbuf,
      gsize backsize,
      gsize backlen
    }

Stream-processing filter modules for MIME data.

`CamelMimeFilter` is an abstract base class for stream-processing modules that transform blocks of data. Filters can be used in three ways:

- Individually — call `camel_mime_filter_filter()` and `camel_mime_filter_complete()` directly to process data buffers.

- Attached to a stream — add to a `CamelStreamFilter` so that data read from or written to the stream is automatically transformed.

- Attached to a parser — register with `CamelMimeParser` 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 (`CamelMimeFilterCharset`), base64 and quoted-printable encoding (`CamelMimeFilterBasic`), line-ending canonicalisation (`CamelMimeFilterCRLF`), gzip compression (`CamelMimeFilterGZip`), HTML conversion (`CamelMimeFilterToHtml`), From-line escaping (`CamelMimeFilterFrom`), and many others.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- CamelMimeFilterBasic
- CamelMimeFilterBestenc
- CamelMimeFilterCRLF
- CamelMimeFilterCanon
- CamelMimeFilterCharset
- CamelMimeFilterEnriched
- CamelMimeFilterFrom
- CamelMimeFilterGZip
- CamelMimeFilterHTML
- CamelMimeFilterIndex
- CamelMimeFilterLinewrap
- CamelMimeFilterPgp
- CamelMimeFilterPreview
- CamelMimeFilterProgress
- CamelMimeFilterToHTML
- CamelMimeFilterWindows
- CamelMimeFilterYenc

#### Constructors

###### camel_mime_filter_new

Create a new `CamelMimeFilter` object.

#### Instance methods

###### camel_mime_filter_backup

Saves `data` to be used as prespace input data to the next call to `camel_mime_filter_filter()` or camel_mime_filter_complete().

###### camel_mime_filter_complete

Passes the input buffer, `in`, through `filter` and generates an output buffer, `out` and makes sure that all data is flushed to the output buffer. This must be the last filtering call made, no further calls to `camel_mime_filter_filter()` may be called on `filter` until `filter` has been reset using camel_mime_filter_reset().

###### camel_mime_filter_filter

Passes the input buffer, `in`, through `filter` and generates an output buffer, `out`.

###### camel_mime_filter_get_request_stop

Returns whether the `filter` requested stop further processing with camel_mime_filter_set_request_stop().

since: 3.52

###### camel_mime_filter_reset

Resets the state on `filter` so that it may be used again.

###### camel_mime_filter_set_request_stop

Sets whether the `filter` requests, or not, stop further processing. This can be used to stop before all the data is filtered.

since: 3.52

###### camel_mime_filter_set_size

Ensure that `filter` has enough storage space to store `size` bytes for filter output.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### 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 CamelMimeFilterClass {
      GObjectClass parent_class;
      void (* filter) (
        CamelMimeFilter* filter,
        const gchar* in,
        gsize len,
        gsize prespace,
        gchar** out,
        gsize* outlen,
        gsize* outprespace
      );
      void (* complete) (
        CamelMimeFilter* filter,
        const gchar* in,
        gsize len,
        gsize prespace,
        gchar** out,
        gsize* outlen,
        gsize* outprespace
      );
      void (* reset) (
        CamelMimeFilter* filter
      );
      gpointer reserved;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`filter: void (* filter) ( CamelMimeFilter* filter, const gchar* in, gsize len, gsize prespace, gchar** out, gsize* outlen, gsize* outprespace )`

  No description available.

`complete: void (* complete) ( CamelMimeFilter* filter, const gchar* in, gsize len, gsize prespace, gchar** out, gsize* outlen, gsize* outprespace )`

  No description available.

`reset: void (* reset) ( CamelMimeFilter* filter )`

  No description available.

`reserved: gpointer`

  No description available.

#### Virtual methods

###### Camel.MimeFilterClass.complete

Passes the input buffer, `in`, through `filter` and generates an output buffer, `out` and makes sure that all data is flushed to the output buffer. This must be the last filtering call made, no further calls to `camel_mime_filter_filter()` may be called on `filter` until `filter` has been reset using camel_mime_filter_reset().

###### Camel.MimeFilterClass.filter

Passes the input buffer, `in`, through `filter` and generates an output buffer, `out`.

###### Camel.MimeFilterClass.reset

Resets the state on `filter` so that it may be used again.