gmime.global

Global functions for gmime3 library

Members

Functions

checkVersion
bool checkVersion(uint major, uint minor, uint micro)

Checks that the GMime library version meets the requirements of the required version.

contentEncodingFromString
gmime.types.ContentEncoding contentEncodingFromString(string str)

Gets the appropriate #GMimeContentEncoding enumeration value based on the input string.

contentEncodingToString
string contentEncodingToString(gmime.types.ContentEncoding encoding)

Gets the string value of the content encoding.

iconvLocaleToUtf8
string iconvLocaleToUtf8(string str)

Allocates a new string buffer containing str in UTF-8.

iconvLocaleToUtf8Length
string iconvLocaleToUtf8Length(string str, size_t n)

Allocates a new string buffer containing the first n bytes of str converted to UTF-8.

iconvUtf8ToLocale
string iconvUtf8ToLocale(string str)

Allocates a new string buffer containing str converted to the user's locale charset.

iconvUtf8ToLocaleLength
string iconvUtf8ToLocaleLength(string str, size_t n)

Allocates a new string buffer containing the first n bytes of str converted to the user's locale charset.

init_
void init_()

Initializes GMime.

localeCharset
string localeCharset()

Gets the user's locale charset (or iso-8859-1 by default).

localeLanguage
string localeLanguage()

Gets the user's locale language code (or null by default).

shutdown
void shutdown()

Frees internally allocated tables created in gmime.global.init_.

utilsBestEncoding
gmime.types.ContentEncoding utilsBestEncoding(ubyte[] text)

Determines the best content encoding for the first len bytes of text.

utilsDecode8bit
string utilsDecode8bit(gmime.parser_options.ParserOptions options, ubyte[] text)

Attempts to convert text in an unknown 8bit/multibyte charset into UTF-8 by finding the charset which will convert the most bytes into valid UTF-8 characters as possible. If no exact match can be found, it will choose the best match and convert invalid byte sequences into question-marks (?) in the returned string buffer.

utilsDecodeMessageId
string utilsDecodeMessageId(string messageId)

Decodes a msg-id as defined by rfc822.

utilsGenerateMessageId
string utilsGenerateMessageId(string fqdn)

Generates a unique Message-Id.

utilsHeaderDecodeDate
glib.date_time.DateTime utilsHeaderDecodeDate(string str)

Parses the rfc822 date string.

utilsHeaderDecodePhrase
string utilsHeaderDecodePhrase(gmime.parser_options.ParserOptions options, string phrase)

Decodes an rfc2047 encoded 'phrase' header.

utilsHeaderDecodeText
string utilsHeaderDecodeText(gmime.parser_options.ParserOptions options, string text)

Decodes an rfc2047 encoded 'text' header.

utilsHeaderEncodePhrase
string utilsHeaderEncodePhrase(gmime.format_options.FormatOptions options, string phrase, string charset)

Encodes a 'phrase' header according to the rules in rfc2047.

utilsHeaderEncodeText
string utilsHeaderEncodeText(gmime.format_options.FormatOptions options, string text, string charset)

Encodes a 'text' header according to the rules in rfc2047.

utilsHeaderFormatDate
string utilsHeaderFormatDate(glib.date_time.DateTime date)

Allocates a string buffer containing the rfc822 formatted date string represented by date.

utilsHeaderUnfold
string utilsHeaderUnfold(string value)

Unfolds a raw header value according to the rules in rfc822.

utilsQuoteString
string utilsQuoteString(string str)

Quotes string as needed according to the rules in rfc2822.

utilsStructuredHeaderFold
string utilsStructuredHeaderFold(gmime.parser_options.ParserOptions options, gmime.format_options.FormatOptions format, string header)

Folds a structured header according to the rules in rfc822.

utilsTextIs8bit
bool utilsTextIs8bit(ubyte[] text)

Determines if text contains 8bit characters within the first len bytes.

utilsUnquoteString
void utilsUnquoteString(string str)

Unquotes and unescapes a string.

utilsUnstructuredHeaderFold
string utilsUnstructuredHeaderFold(gmime.parser_options.ParserOptions options, gmime.format_options.FormatOptions format, string header)

Folds an unstructured header according to the rules in rfc822.

ydecodeStep
size_t ydecodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint pcrc, uint crc)

Performs a 'decode step' on a chunk of yEncoded data of length inlen pointed to by inbuf and writes to outbuf. Assumes the =ybegin and =ypart lines have already been stripped off.

yencodeClose
size_t yencodeClose(ubyte[] inbuf, ubyte[] outbuf, int state, uint pcrc, uint crc)

Call this function when finished encoding data with gmime.global.yencodeStep to flush off the remaining state.

yencodeStep
size_t yencodeStep(ubyte[] inbuf, ubyte[] outbuf, int state, uint pcrc, uint crc)

Performs an yEncode 'encode step' on a chunk of raw data of length inlen pointed to by inbuf and writes to outbuf.