KMime::Headers::Generics::Structured Class

class KMime::Headers::Generics::Structured

Base class for structured header fields. More...

Public Functions

Protected Functions

virtual bool parse(const char *&scursor, const char *const send, KMime::NewlineType newline = NewlineType::LF) = 0

Detailed Description

This is the base class for all structured header fields. It contains parsing methods for all basic token types found in rfc2822.

At the basic level, there are tokens & tspecials (rfc2045), atoms & specials, quoted-strings, domain-literals (all rfc822) and encoded-words (rfc2047).

As a special token, we have the comment. It is one of the basic tokens defined in rfc822, but it's parsing relies in part on the basic token parsers (e.g. comments may contain encoded-words). Also, most upper-level parsers (notably those for phrase and dot-atom) choose to ignore any comment when parsing.

Then there are the real composite tokens, which are made up of one or more of the basic tokens (and semantically invisible comments): phrases (rfc822 with rfc2047) and dot-atoms (rfc2822).

This finishes the list of supported token types. Subclasses will provide support for more higher-level tokens, where necessary, using these parsers.

Member Function Documentation

Structured::Structured()

[pure virtual protected] bool Structured::parse(const char *&scursor, const char *const send, KMime::NewlineType newline = NewlineType::LF)

This method parses the raw header and needs to be implemented in every sub-class.

scursor Pointer to the start of the data still to parse.

send Pointer to the end of the data.

newline whether the input string is terminated with CRLF or LF.