-public:
- typedef std::vector<typename ELEMENT_PARSER::INFO> INFO;
- typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
- PARSER(const std::string & t, CALLBACK f, void * d, const std::string & e)
- : tag(t), callback(f), data(d), encoding(e),
- elementParser(&PARSER<ELEMENT_PARSER>::ElementCallback, this, e),
- depth(0), parsingAnswer(false)
- {}
- int ParseStart(const char * el, const char ** attr)
- {
- depth++;
- if (depth == 1 && strcasecmp(el, tag.c_str()) == 0)
- parsingAnswer = true;
-
- if (depth > 1 && parsingAnswer)
- elementParser.ParseStart(el, attr);
-
- return 0;
- }
- void ParseEnd(const char * el)
- {
- depth--;
- if (depth > 0 && parsingAnswer)
- elementParser.ParseEnd(el);
-
- if (depth == 0 && parsingAnswer)
+ public:
+ using Info = std::vector<typename ElementParser::Info>;
+ using Callback = void (*)(bool result, const std::string& reason, const Info& info, void* data);
+
+ Parser(const std::string& t, Callback f, void* d, const std::string& e)
+ : tag(t), callback(f), data(d), encoding(e),
+ elementParser(&Parser<ElementParser>::ElementCallback, this, e),
+ depth(0), parsingAnswer(false)
+ {}
+
+ int ParseStart(const char* el, const char** attr) override
+ {
+ depth++;
+ if (depth == 1 && strcasecmp(el, tag.c_str()) == 0)
+ parsingAnswer = true;
+
+ if (depth > 1 && parsingAnswer)
+ elementParser.ParseStart(el, attr);
+
+ return 0;
+ }
+ void ParseEnd(const char* el) override