#ifndef __STG_STGLIBS_SRVCONF_PARSER_GET_USER_H__
#define __STG_STGLIBS_SRVCONF_PARSER_GET_USER_H__
-#include "stg/parser.h"
+#include "parser.h"
+
+#include "property_parsers.h"
#include "stg/os_int.h"
+#include "stg/const.h"
#include <string>
-#include <map>
#include <ctime>
-class BASE_PROPERTY_PARSER
-{
- public:
- virtual bool Parse(const char ** attr) = 0;
-};
-
-template <typename T>
-class PROPERTY_PARSER
-{
- public:
- typedef T (* FUNC)(const char **);
- PROPERTY_PARSER(T & v, FUNC f) : value(v), func(f) {}
- virtual void Parse(const char ** attr) { value = func(attr); }
- private:
- T & value;
- FUNC func;
-};
-
-typedef std::map<std::string, BASE_PROPERTY_PARSER *> PROPERTY_PARSERS;
-
class PARSER_GET_USER: public PARSER
{
public:
std::string userData[USERDATA_NUM];
};
- typedef void (* CALLBACK)(const INFO & info, void * data);
+ typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
PARSER_GET_USER();
virtual ~PARSER_GET_USER();
void * data;
INFO info;
int depth;
+ bool parsingAnswer;
+ std::string error;
void ParseUser(const char *el, const char **attr);
void ParseUserParams(const char *el, const char **attr);