X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..63ec10fdcc402bf07f7a8c0dfb326feb60249038:/stglibs/srvconf.lib/servconf.h?ds=inline diff --git a/stglibs/srvconf.lib/servconf.h b/stglibs/srvconf.lib/servconf.h index f3beaec3..9edbe6dd 100644 --- a/stglibs/srvconf.lib/servconf.h +++ b/stglibs/srvconf.lib/servconf.h @@ -27,11 +27,12 @@ #ifndef SERVCONF_H #define SERVCONF_H -#include "os_int.h" - #include + #include #include + +#include "os_int.h" #include "netunit.h" #include "stg_const.h" @@ -108,16 +109,10 @@ struct ADMINDATA class PARSER { public: - PARSER(); - virtual ~PARSER(){}; + PARSER() {} + virtual ~PARSER() {} virtual int ParseStart(const char *el, const char **attr) = 0; virtual void ParseEnd(const char *el) = 0; - void Reset(); - //virtual bool GetError() = 0; - //virtual void SetUserDataRecvCb(RecvUserDataCb_t) = 0; -protected: - //RecvUserDataCb_t RecvUserDataCb; -private: }; //----------------------------------------------------------------------------- class PARSER_CHG_USER: public PARSER @@ -126,7 +121,6 @@ public: PARSER_CHG_USER(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseAnswer(const char *el, const char **attr); void SetChgUserRecvCb(RecvChgUserCb_t, void * data); private: @@ -142,7 +136,6 @@ public: PARSER_CHECK_USER(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseAnswer(const char *el, const char **attr); void SetCheckUserRecvCb(RecvCheckUserCb_t, void * data); private: @@ -158,12 +151,10 @@ public: PARSER_GET_USERS(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseUsers(const char *el, const char **attr); void ParseUser(const char *el, const char **attr); void ParseUserParams(const char *el, const char **attr); void ParseUserLoadStat(const char * el, const char ** attr); - //bool GetError(); void SetUserDataRecvCb(RecvUserDataCb_t, void * data); private: RecvUserDataCb_t RecvUserDataCb; @@ -179,7 +170,6 @@ public: PARSER_GET_USER(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseUsers(const char *el, const char **attr); void ParseUser(const char *el, const char **attr); void ParseUserParams(const char *el, const char **attr); @@ -199,7 +189,6 @@ public: PARSER_GET_SERVER_INFO(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseServerInfo(const char *el, const char **attr); bool GetError(); void SetServerInfoRecvCb(RecvServerInfoDataCb_t, void * data); @@ -226,7 +215,6 @@ public: PARSER_SEND_MESSAGE(); int ParseStart(const char *el, const char **attr); void ParseEnd(const char *el); - void Reset(); void ParseAnswer(const char *el, const char **attr); void SetSendMessageRecvCb(RecvSendMessageCb_t, void * data); private: @@ -262,8 +250,8 @@ public: int GetServerInfo(); int CheckUser(const char * login, const char * password); - char * GetStrError(); - int GetError(); + const std::string & GetStrError() const; + int GetError(); int Start(const char *el, const char **attr); void End(const char *el); @@ -281,9 +269,9 @@ private: int parseDepth; USERDATA ud; - char errorMsg[MAX_ERR_STR_LEN]; - int error; - XML_Parser parser; + std::string errorMsg; + int error; + XML_Parser parser; RecvUserDataCb_t RecvUserDataCb; RecvUserDataCb_t RecvGetUserDataCb; @@ -304,6 +292,3 @@ private: //----------------------------------------------------------------------------- #endif /* _SERVCONF_H_ */ - -/* EOF */ -