GMimeFilterBasic

GMimeFilterBasic — Basic transfer encoding filter

Functions

Types and Values

Description

A GMimeFilter which can encode or decode basic MIME encodings such as Quoted-Printable, Base64 and UUEncode, or use an explicitly supplied GMimeYencEncoder or GMimeYencDecoder for yEnc.

The g_mime_filter_basic_create_encoder() and g_mime_filter_basic_create_decoder() factory families follow MimeKit's encoding selection, returning GMimeFilterPassThrough for unhandled encodings. Encoder factories default to CRLF, unlike the existing LF-based g_mime_filter_basic_new() constructor.

Functions

g_mime_filter_basic_new ()

GMimeFilter *
g_mime_filter_basic_new (GMimeContentEncoding encoding,
                         gboolean encode);

Creates a new basic filter for encoding . Encoders use LF line endings. Unspecified, 7bit, 8bit and binary encodings use copying pass-through codecs, unlike g_mime_filter_basic_create_encoder() and g_mime_filter_basic_create_decoder(), which return GMimeFilterPassThrough.

Parameters

encoding

a GMimeContentEncoding

 

encode

TRUE to encode or FALSE to decode

 

Returns

a new basic encoder filter.


g_mime_filter_basic_new_with_encoder ()

GMimeFilter *
g_mime_filter_basic_new_with_encoder (GMimeEncoder *encoder);

The filter retains a reference and uses the encoder's current state. Copies of the filter use independent, reset clones of the encoder.

Parameters

encoder

an encoder.

[transfer none]

Returns

a new encoding filter.

[transfer full]


g_mime_filter_basic_new_with_decoder ()

GMimeFilter *
g_mime_filter_basic_new_with_decoder (GMimeDecoder *decoder);

The filter retains a reference and uses the decoder's current state. Copies of the filter use independent, reset clones of the decoder.

Parameters

decoder

a decoder.

[transfer none]

Returns

a new decoding filter.

[transfer full]


g_mime_filter_basic_create_encoder ()

GMimeFilter *
g_mime_filter_basic_create_encoder (GMimeContentEncoding encoding);

Creates an encoding filter using CRLF line endings and a maximum line length of 78, capped by the selected encoder's MIME limits. Encodings other than Base64, quoted-printable and uuencode pass through unchanged without copying or allocating an output buffer.

Parameters

encoding

a content encoding, including unrecognized enum values

 

Returns

a new encoding or pass-through filter.

[transfer full]


g_mime_filter_basic_create_encoder_with_newline_format ()

GMimeFilter *
g_mime_filter_basic_create_encoder_with_newline_format
                               (GMimeContentEncoding encoding,
                                GMimeNewLineFormat newline_format,
                                guint max_line_length);

Creates a Base64, quoted-printable or uuencode filter with the selected line endings. Base64 and quoted-printable require a line length between 60 and 998 and cap it at 76. uuencode and unhandled encodings ignore the line-length argument. Unhandled encodings return GMimeFilterPassThrough. The newline format must be valid even for pass-through filters.

Parameters

encoding

a content encoding, including unrecognized enum values

 

newline_format

LF or CRLF line endings

 

max_line_length

a maximum line length, excluding the terminator

 

Returns

a new encoding or pass-through filter.

[transfer full]


g_mime_filter_basic_create_encoder_by_name ()

GMimeFilter *
g_mime_filter_basic_create_encoder_by_name
                               (const char *name);

Creates an encoding filter using CRLF and a maximum line length of 78. Matching is case-insensitive, skips leading Unicode whitespace, and stops at the first whitespace or semicolon. Unknown names pass through unchanged without copying.

Parameters

name

a non-NULL UTF-8 content-transfer-encoding name

 

Returns

a new encoding or pass-through filter.

[transfer full]


g_mime_filter_basic_create_encoder_by_name_with_newline_format ()

GMimeFilter *
g_mime_filter_basic_create_encoder_by_name_with_newline_format
                               (const char *name,
                                GMimeNewLineFormat newline_format,
                                guint max_line_length);

Resolves name as in g_mime_filter_basic_create_encoder_by_name() and selects a filter as in g_mime_filter_basic_create_encoder_with_newline_format(). Base64 and quoted-printable validate max_line_length ; other encodings ignore it. The newline format is always validated.

Parameters

name

a non-NULL UTF-8 content-transfer-encoding name

 

newline_format

LF or CRLF line endings

 

max_line_length

a maximum line length, excluding the terminator

 

Returns

a new encoding or pass-through filter.

[transfer full]


g_mime_filter_basic_create_decoder ()

GMimeFilter *
g_mime_filter_basic_create_decoder (GMimeContentEncoding encoding);

Creates a Base64, quoted-printable or uuencode decoder filter. The UU decoder looks for a begin-line before decoding the payload. Other encodings pass through unchanged without copying.

Parameters

encoding

a content encoding, including unrecognized enum values

 

Returns

a new decoding or pass-through filter.

[transfer full]


g_mime_filter_basic_create_decoder_by_name ()

GMimeFilter *
g_mime_filter_basic_create_decoder_by_name
                               (const char *name);

Resolves name as in g_mime_filter_basic_create_encoder_by_name() and selects a filter as in g_mime_filter_basic_create_decoder().

Parameters

name

a non-NULL UTF-8 content-transfer-encoding name

 

Returns

a new decoding or pass-through filter.

[transfer full]

Types and Values

GMimeFilterBasic

typedef struct _GMimeFilterBasic GMimeFilterBasic;

A basic encoder/decoder filter for the MIME encodings.

See Also

GMimeFilter