Encoding

A context used for encoding or decoding data.

Members

Functions

flush
size_t flush(string inbuf, char[] outbuf)

Completes the incremental encode or decode of the input stream (see gmime.encoding.Encoding.step for details).

initDecode
void initDecode(gmime.types.ContentEncoding encoding)

Initializes a #GMimeEncoding state machine for decoding from encoding.

initEncode
void initEncode(gmime.types.ContentEncoding encoding)

Initializes a #GMimeEncoding state machine for encoding to encoding.

outlen
size_t outlen(size_t inlen)

Given the input length, inlen, calculate the needed output length to perform an encoding or decoding step.

reset
void reset()

Resets the state of the #GMimeEncoding.

step
size_t step(string inbuf, char[] outbuf)

Incrementally encodes or decodes (depending on state) an input stream by 'stepping' through a block of input at a time.

Static functions

base64DecodeStep
size_t base64DecodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Decodes a chunk of base64 encoded data.

base64EncodeClose
size_t base64EncodeClose(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Base64 encodes the input stream to the output stream. Call this when finished encoding data with gmime.encoding.Encoding.base64EncodeStep to flush off the last little bit.

base64EncodeStep
size_t base64EncodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Base64 encodes a chunk of data. Performs an 'encode step', only encodes blocks of 3 characters to the output at a time, saves left-over state in state and save (initialise to 0 on first invocation).

quotedDecodeStep
size_t quotedDecodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Decodes a block of quoted-printable encoded data. Performs a 'decode step' on a chunk of QP encoded data.

quotedEncodeClose
size_t quotedEncodeClose(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Quoted-printable encodes a block of text. Call this when finished encoding data with gmime.encoding.Encoding.quotedEncodeStep to flush off the last little bit.

quotedEncodeStep
size_t quotedEncodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Quoted-printable encodes a block of text. Performs an 'encode step', saves left-over state in state and save (initialise to -1 on first invocation).

uudecodeStep
size_t uudecodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint save)

Uudecodes a chunk of data. Performs a 'decode step' on a chunk of uuencoded data. Assumes the "begin mode filename" line has been stripped off.

uuencodeClose
size_t uuencodeClose(ubyte[] inbuf, ubyte[] outbuf, ubyte[] uubuf, int state, uint save)

Uuencodes a chunk of data. Call this when finished encoding data with gmime.encoding.Encoding.uuencodeStep to flush off the last little bit.

uuencodeStep
size_t uuencodeStep(ubyte[] inbuf, ubyte[] outbuf, ubyte[] uubuf, int state, uint save)

Uuencodes a chunk of data. Performs an 'encode step', only encodes blocks of 45 characters to the output at a time, saves left-over state in uubuf, state and save (initialize to 0 on first invocation).

Variables

encode
gboolean encode;

true if encoding or false if decoding

encoding
ContentEncoding encoding;

the type of encoding

save
uint save;

saved bytes from the previous step

state
int state;

current encder/decoder state

uubuf
ubyte[60] uubuf;

a temporary buffer needed when uuencoding data