X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a8689998a9b2cfc17dc260b423cce8ff2e407adb..6bd4918f85f22955197b200d79972d22159e89d8:/stglibs/srvconf.lib/include/stg/parser_get_user.h diff --git a/stglibs/srvconf.lib/include/stg/parser_get_user.h b/stglibs/srvconf.lib/include/stg/parser_get_user.h index 8fc894a4..7f6faaad 100644 --- a/stglibs/srvconf.lib/include/stg/parser_get_user.h +++ b/stglibs/srvconf.lib/include/stg/parser_get_user.h @@ -22,35 +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: @@ -90,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(); @@ -103,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);