KMIME Library
KMime::Headers::Generics::Structured Class Reference
Base class for structured header fields. More...
#include <kmime_headers.h>

Public Member Functions | |
virtual QString | asUnicodeString () const |
virtual void | from7BitString (const QByteArray &s) |
virtual void | fromUnicodeString (const QString &s, const QByteArray &b) |
Structured (Content *p, const QString &s, const QByteArray &cs) | |
Structured (Content *p, const QByteArray &s) | |
Structured (Content *p=0) | |
Protected Member Functions | |
virtual bool | parse (const char *&scursor, const char *const send, bool isCRLF=false)=0 |
Detailed Description
Base class for structured header fields.This is the base class for all structured header fields. It contains parsing methods for all basic token types found in rfc2822.
Parsing
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.
Definition at line 318 of file kmime_headers.h.
Member Function Documentation
QString KMime::Headers::Generics::Structured::asUnicodeString | ( | ) | const [virtual] |
Returns the decoded content of the header without the header-type.
Implements KMime::Headers::Base.
Reimplemented in KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::AddressList, KMime::Headers::Generics::PhraseList, KMime::Headers::Generics::DotAtom, KMime::Headers::MailCopiesTo, KMime::Headers::Newsgroups, and KMime::Headers::Lines.
Definition at line 303 of file kmime_headers.cpp.
void KMime::Headers::Generics::Structured::from7BitString | ( | const QByteArray & | s | ) | [virtual] |
Parses the given string.
Take care of RFC2047-encoded strings.
- Parameters:
-
s The encoded header data.
Implements KMime::Headers::Base.
Definition at line 293 of file kmime_headers.cpp.
void KMime::Headers::Generics::Structured::fromUnicodeString | ( | const QString & | s, | |
const QByteArray & | b | |||
) | [virtual] |
Parses the given string and set the charset.
- Parameters:
-
s The header data as unicode string. b The charset preferred for encoding.
Implements KMime::Headers::Base.
Reimplemented in KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::AddressList, and KMime::Headers::Newsgroups.
Definition at line 308 of file kmime_headers.cpp.
virtual bool KMime::Headers::Generics::Structured::parse | ( | const char *& | scursor, | |
const char *const | send, | |||
bool | isCRLF = false | |||
) | [protected, pure virtual] |
This method parses the raw header and needs to be implemented in every sub-class.
- Parameters:
-
scursor Pointer to the start of the data still to parse. send Pointer to the end of the data. isCRLF true if input string is terminated with a CRLF.
Implemented in KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::SingleMailbox, KMime::Headers::Generics::AddressList, KMime::Headers::Generics::Ident, KMime::Headers::Generics::SingleIdent, KMime::Headers::Generics::Token, KMime::Headers::Generics::PhraseList, KMime::Headers::Generics::DotAtom, KMime::Headers::Generics::Parametrized, KMime::Headers::ReturnPath, KMime::Headers::MailCopiesTo, KMime::Headers::ContentTransferEncoding, KMime::Headers::ContentType, KMime::Headers::ContentDisposition, KMime::Headers::Control, KMime::Headers::Date, KMime::Headers::Newsgroups, and KMime::Headers::Lines.
The documentation for this class was generated from the following files: