5 // TODO: Fix this shit!
6 #include "../../../tariffs.h"
7 #include "../../../users.h"
8 #include "../../../admin.h"
9 #include "../../../settings.h"
11 #include "parser_info.h"
12 #include "parser_getuser.h"
13 #include "parser_getusers.h"
14 #include "root_parser.h"
16 ROOT_PARSER::ROOT_PARSER(const ADMIN * ca, TARIFFS * t, USERS * u, const SETTINGS * s)
24 handlerResult("<error message=\"Not implemented yet\"/>")
27 handlers["GetServerInfo"] = new PARSER_GET_SERVER_INFO(settings,
28 tariffs->GetTariffsNum(),
30 handlers["GetUser"] = new PARSER_GET_USER(currAdmin, users);
31 handlers["GetUsers"] = new PARSER_GET_USERS(currAdmin, users);
34 ROOT_PARSER::~ROOT_PARSER()
36 std::map<std::string, PARSER *>::iterator it;
38 for (it = handlers.begin(); it != handlers.end(); ++it) {
43 bool ROOT_PARSER::StartTag(const char * name, const char ** attr)
46 handlerResult = "<error message=\"Not implemented yet\"/>";
52 //assert(handler != NULL);
55 return handler->StartTag(name, attr);
60 bool ROOT_PARSER::EndTag(const char * name)
66 res = handler->EndTag(name);
73 if (handler != NULL) {
74 handlerResult = handler->GetResult();
82 bool ROOT_PARSER::Dispatch(const std::string & name)
84 HMAP_ITERATOR it(handlers.find(name));
86 if (it == handlers.end()) {
87 printfd(__FILE__, "ROOT_PARSER::Dispatch() Handler for '%s' not found.\n", name.c_str());