| Top |
| GMimeContentEncoding | g_mime_decoder_get_encoding () |
| GMimeDecoder * | g_mime_decoder_clone () |
| gsize | g_mime_decoder_estimate_output_length () |
| gsize | g_mime_decoder_decode () |
| gsize | g_mime_decoder_flush () |
| void | g_mime_decoder_reset () |
Decoders retain incomplete sequences between calls. Malformed encoded input
follows MimeKit's tolerant recovery rather than reporting argument errors.
Overlapping buffers are supported, copying the input when necessary.
Complete each encoded stream with g_mime_decoder_flush(), even when no
input remains. Reset before decoding a new stream.
GMimeContentEncoding
g_mime_decoder_get_encoding (GMimeDecoder *decoder);
gsize g_mime_decoder_estimate_output_length (GMimeDecoder *decoder,gsize input_length);
Includes buffered input emitted by decode or flush without changing state.
gsize g_mime_decoder_decode (GMimeDecoder *decoder,const guint8 *input,gsize input_length,guint8 *output,gsize output_capacity);
Argument violations are programming errors checked before changing state.
Empty input does not finalize incomplete sequences; use
g_mime_decoder_flush() at the end of the encoded stream.
decoder |
a decoder |
|
input |
input bytes. |
[nullable][array length=input_length] |
input_length |
input length |
|
output |
writable output buffer. |
[out caller-allocates][array length=output_capacity] |
output_capacity |
capacity, at least the estimated output length |
gsize g_mime_decoder_flush (GMimeDecoder *decoder,const guint8 *input,gsize input_length,guint8 *output,gsize output_capacity);
Decodes final input and emits recoverable buffered bytes. Base64 and uuencode recover complete bytes from partial groups; quoted-printable preserves incomplete escapes literally. Fragments that cannot produce a byte are discarded. yEnc discards dangling escapes and incomplete framing, preserving its running checksum.
Call even when the final input is empty. Repeated empty flushes produce
no more output. Reset before decoding another stream. Buffer overlap and
argument checks follow g_mime_decoder_decode(); capacity must include
buffered input as reported by g_mime_decoder_estimate_output_length().
decoder |
a decoder |
|
input |
final input bytes. |
[nullable][array length=input_length] |
input_length |
input length, or zero to complete previously decoded input |
|
output |
writable output buffer. |
[out caller-allocates][array length=output_capacity] |
output_capacity |
capacity, at least the estimated output length |
void
g_mime_decoder_reset (GMimeDecoder *decoder);
Discards incomplete sequences and resets the decoder.