]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig-ng/root_parser.h
8d722e873ec17197d9e327cc45325ed53a78b129
[stg.git] / projects / stargazer / plugins / configuration / sgconfig-ng / root_parser.h
1 #ifndef __ROOT_PARSER_H__
2 #define __ROOT_PARSER_H__
3
4 #include <map>
5 #include <string>
6
7 #include "parser.h"
8
9 class TARIFFS;
10 class USERS;
11 class ADMIN;
12 class SETTINGS;
13
14 class ROOT_PARSER : public PARSER {
15     public:
16         ROOT_PARSER(const ADMIN * ca, TARIFFS * t, USERS * u, const SETTINGS * s);
17         ~ROOT_PARSER();
18
19         bool StartTag(const char * name, const char ** attr);
20         bool EndTag(const char * name);
21         const std::string & GetResult() const { return handlerResult; };
22
23     private:
24         TARIFFS * tariffs;
25         USERS * users;
26         const ADMIN * currAdmin;
27         const SETTINGS * settings;
28
29         typedef std::map<std::string, PARSER *> HMAP;
30         typedef HMAP::iterator HMAP_ITERATOR;
31
32         HMAP handlers;
33         PARSER * handler;
34         int depth;
35         std::string handlerResult;
36
37         bool Dispatch(const std::string & name);
38 };
39
40 #endif