X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/17dab87336302938de1f031008cc4c4af31d2590..359e4b28458d352dc55ac39db7e4b5bb308eb361:/stglibs/srvconf.lib/include/stg/parser_get_user.h?ds=inline diff --git a/stglibs/srvconf.lib/include/stg/parser_get_user.h b/stglibs/srvconf.lib/include/stg/parser_get_user.h index 575b0e46..7f6faaad 100644 --- a/stglibs/srvconf.lib/include/stg/parser_get_user.h +++ b/stglibs/srvconf.lib/include/stg/parser_get_user.h @@ -22,36 +22,17 @@ #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 -#include #include -class BASE_PROPERTY_PARSER -{ - public: - virtual bool Parse(const char ** attr) = 0; -}; - -template -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 PROPERTY_PARSERS; - class PARSER_GET_USER: public PARSER { public: @@ -91,7 +72,7 @@ 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(); @@ -104,6 +85,8 @@ private: 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);