#include <parser.h>
Public Methods | |
parser () | |
c'tor. More... | |
virtual | ~parser () |
d'tor. More... | |
virtual bool | parse (const string &s) |
parses an entry. More... | |
virtual const string & | getValue (const string &item) |
returns a special value. More... | |
Static Public Attributes | |
string | undef |
a dummy return value. More... | |
Protected Types | |
enum | { text = 0, special, comment } |
Protected Methods | |
virtual bool | onToken (const char *t, int mode) |
Callback for the parse() method. More... | |
virtual bool | error (const string &err) |
called on error. More... | |
void | registerParser (const string &name) |
registers this parser for a certain item. More... |
The header class uses objects of this class or derivees to handle entry-specific parsings, for example, when parsing a "From:" line into realname and email address, or parsing the "Date:" line into somewhat machine readable.
Normally you would not need to instantiate such a class.
|
|
|
c'tor.
|
|
d'tor.
|
|
called on error.
|
|
returns a special value. When, as usual, used and registered as a helper class for the rfc822::header class, the rfc822::header methods will call this method to query the special value. For example, the "From:" parser implements return values for "from.email" and "from.realname".
|
|
Callback for the parse() method.
|
|
parses an entry. The default implementation parses the entries value into text, specials, and comments in a way similar to what RFC822 describes. It then feeds the tokens into the onToken() method.
|
|
registers this parser for a certain item. This method is a shortcut for calling header::registerSpecial(). |
|
a dummy return value.
|