X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e87b76d3a75c2833d2a646b38210584dc1a93624..82c7b78d7b7cf797f0663c96f44b092103802035:/stglibs/srvconf.lib/servconf.cpp?ds=sidebyside diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index c45dfb9b..a7663f0e 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -21,7 +21,7 @@ #include "stg/servconf.h" #include "netunit.h" -#include "stg/servconf_types.h" +#include "parser_auth_by.h" #include "stg/common.h" @@ -30,6 +30,8 @@ #include +using namespace STG; + class SERVCONF::IMPL { public: @@ -39,7 +41,7 @@ public: int GetUsers(PARSER_GET_USERS::CALLBACK f, void * data); int GetUser(const std::string & login, PARSER_GET_USER::CALLBACK f, void * data); int ChgUser(const std::string & request, PARSER_CHG_USER::CALLBACK f, void * data); - int AuthBy(const std::string & login, PARSER_AUTH_BY::CALLBACK f, void * data); + int AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data); int SendMessage(const std::string & request, PARSER_SEND_MESSAGE::CALLBACK f, void * data); int ServerInfo(PARSER_SERVER_INFO::CALLBACK f, void * data); int CheckUser(const std::string & login, const std::string & password, PARSER_CHECK_USER::CALLBACK f, void * data); @@ -51,7 +53,7 @@ public: private: PARSER_GET_USERS parserGetUsers; PARSER_GET_USER parserGetUser; - PARSER_AUTH_BY parserAuthBy; + AUTH_BY::PARSER parserAuthBy; PARSER_SERVER_INFO parserServerInfo; PARSER_CHG_USER parserChgUser; PARSER_CHECK_USER parserCheckUser; @@ -67,22 +69,6 @@ private: static bool AnsRecv(void * data, const std::string & chunk, bool final); }; -/*namespace -{ - -void ElementStart(void * data, const char * el, const char ** attr) -{ -static_cast(data)->Start(el, attr); -} - -void ElementEnd(void * data, const char * el) -{ -static_cast(data)->End(el); -} - -} // namespace anonymous -*/ - bool SERVCONF::IMPL::AnsRecv(void * data, const std::string & chunk, bool final) { SERVCONF::IMPL * sc = static_cast(data); @@ -125,7 +111,7 @@ int SERVCONF::ChgUser(const std::string & request, PARSER_CHG_USER::CALLBACK f, return pImpl->ChgUser(request, f, data); } -int SERVCONF::AuthBy(const std::string & login, PARSER_AUTH_BY::CALLBACK f, void * data) +int SERVCONF::AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data) { return pImpl->AuthBy(login, f, data); } @@ -165,7 +151,7 @@ parserGetUser.SetCallback(f, data); return Exec("", parserGetUser); } //----------------------------------------------------------------------------- -int SERVCONF::IMPL::AuthBy(const std::string & login, PARSER_AUTH_BY::CALLBACK f, void * data) +int SERVCONF::IMPL::AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data) { parserAuthBy.SetCallback(f, data); return Exec("", parserAuthBy);