00001
00002 #ifndef PARSER_H
00003 #define PARSER_H
00004
00005 #include <string>
00006
00007 #include <mime/client.h>
00008 #include <mime/object.h>
00009
00010 namespace mime {
00011
00012 class parser {
00013 public:
00014 virtual void parse(unsigned char c) = 0;
00015 virtual void close() {}
00016 };
00017
00018 class object_parser : public parser {
00019 protected:
00020 client_interface* client;
00021 object *obj;
00022 public:
00023 object_parser(client_interface* client, object* obj) {
00024 this->client = client;
00025 this->obj = obj;
00026 }
00027 };
00028
00029 class object_body_parser : public object_parser {
00030 public:
00031 object_body_parser(client_interface* client, object* obj) :
00032 object_parser(client, obj)
00033 {
00034 }
00035 };
00036
00037 }
00038
00039 #endif
00040