GMimeFilter: GMime 3.0 Reference Manual

## GMimeFilter

GMimeFilter — Abstract filter class

## Functions

GMimeFilter * | g_mime_filter_copy ()
void | g_mime_filter_filter ()
void | g_mime_filter_complete ()
void | g_mime_filter_reset ()
void | g_mime_filter_backup ()
void | g_mime_filter_set_size ()

## Types and Values

struct | GMimeFilter

## Object Hierarchy

        GObject
        ╰── GMimeFilter
            ├── GMimeFilterBasic
            ├── GMimeFilterBest
            ├── GMimeFilterCharset
            ├── GMimeFilterChecksum
            ├── GMimeFilterDos2Unix
            ├── GMimeFilterEnriched
            ├── GMimeFilterFrom
            ├── GMimeFilterGZip
            ├── GMimeFilterHTML
            ├── GMimeFilterOpenPGP
            ├── GMimeFilterSmtpData
            ├── GMimeFilterStrip
            ├── GMimeFilterUnix2Dos
            ├── GMimeFilterWindows
            ╰── GMimeFilterYenc

## Description

Stream filters are an efficient way of converting data from one format to another.

## Functions

### g_mime_filter_copy ()

    GMimeFilter *
    g_mime_filter_copy (GMimeFilter *filter);

Copies `filter` into a new GMimeFilter object.

#### Parameters

filter | filter |

#### Returns

a duplicate of `filter` .

[transfer full]

### g_mime_filter_filter ()

    void
    g_mime_filter_filter (GMimeFilter *filter,
                          char *inbuf,
                          size_t inlen,
                          size_t prespace,
                          char **outbuf,
                          size_t *outlen,
                          size_t *outprespace);

Filters the input data and writes it to `out` .

#### Parameters

filter | filter |
inbuf | input buffer. | [array length=inlen][element-type guint8]
inlen | input buffer length |
prespace | prespace buffer length |
outbuf | pointer to output buffer. | [out][array length=outlen][element-type guint8][transfer none]
outlen | pointer to output length. | [out]
outprespace | pointer to output prespace buffer length. | [out]

### g_mime_filter_complete ()

    void
    g_mime_filter_complete (GMimeFilter *filter,
                            char *inbuf,
                            size_t inlen,
                            size_t prespace,
                            char **outbuf,
                            size_t *outlen,
                            size_t *outprespace);

Completes the filtering.

#### Parameters

filter | filter |
inbuf | input buffer. | [array length=inlen][element-type guint8]
inlen | input buffer length |
prespace | prespace buffer length |
outbuf | pointer to output buffer. | [out][array length=outlen][element-type guint8][transfer none]
outlen | pointer to output length. | [out]
outprespace | pointer to output prespace buffer length. | [out]

### g_mime_filter_reset ()

    void
    g_mime_filter_reset (GMimeFilter *filter);

Resets the filter.

#### Parameters

filter | a GMimeFilter object |

### g_mime_filter_backup ()

    void
    g_mime_filter_backup (GMimeFilter *filter,
                          const char *data,
                          size_t length);

Sets number of bytes backed up on the input, new calls replace previous ones

#### Parameters

filter | filter |
data | data to backup. | [array length=length][element-type guint8]
length | length of `data` |

### g_mime_filter_set_size ()

    void
    g_mime_filter_set_size (GMimeFilter *filter,
                            size_t size,
                            gboolean keep);

Ensure this much size is available for filter output (if required)

#### Parameters

filter | filter |
size | requested size for the output buffer |
keep | `TRUE` if existing data in the output buffer should be kept |

## Types and Values

### struct GMimeFilter

    struct GMimeFilter;

Base class for filters used by GMimeStreamFilter.

#### Members

## See Also

GMimeStreamFilter