00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #ifndef RFC822_PARSER_H
00010 #define RFC822_PARSER_H
00011 
00012 #include <string>
00013 
00014 #include <rfc822/header.h>
00015 
00016 using namespace std;
00017 
00018 namespace rfc822
00019 {
00020 
00022 
00030 class parser
00031 {
00032 public:
00034         parser();
00035 
00037         virtual ~parser();
00038 
00040 
00048         virtual bool parse(const string& s);
00049         
00051 
00061         virtual const string& getValue(const string& item);
00062         
00064         static string undef;
00065         
00066 protected:
00067         enum {
00068                 text = 0,
00069                 special,
00070                 comment,
00071         };
00072 
00074 
00080         virtual bool onToken(const char* t, int mode);
00081         
00083         virtual bool error(const string& err);
00084         
00086 
00089         void registerParser(const string& name)
00090                 { header::registerParser(this, name); }
00091 };
00092 
00093 };      
00094 
00095 
00096 #endif