From: Maxim Mamontov Date: Wed, 8 Dec 2010 14:28:52 +0000 (+0200) Subject: В парсерах библиотеки поддержки протокола конфигуратора добавлены X-Git-Tag: 2.407-rc3~310 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/cdd6c43fceeb5a37867ae902bb71429abad7fa64 В парсерах библиотеки поддержки протокола конфигуратора добавлены конструкторы, проведена инициализация членов, убраны неиспользуемые методы --- diff --git a/stglibs/srvconf.lib/parser.cpp b/stglibs/srvconf.lib/parser.cpp index 7c96b2ed..139c91bc 100644 --- a/stglibs/srvconf.lib/parser.cpp +++ b/stglibs/srvconf.lib/parser.cpp @@ -40,23 +40,15 @@ using namespace std; -//----------------------------------------------------------------------------- -PARSER::PARSER() -{ -} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_GET_USERS::PARSER_GET_USERS() + : RecvUserDataCb(NULL), + userDataCb(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvUserDataCb = NULL; -} -//----------------------------------------------------------------------------- -void PARSER_GET_USERS::Reset() -{ - } //----------------------------------------------------------------------------- int PARSER_GET_USERS::ParseStart(const char *el, const char **attr) @@ -385,15 +377,11 @@ userDataCb = data; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_GET_USER::PARSER_GET_USER() + : RecvUserDataCb(NULL), + userDataCb(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvUserDataCb = NULL; -} -//----------------------------------------------------------------------------- -void PARSER_GET_USER::Reset() -{ - } //----------------------------------------------------------------------------- int PARSER_GET_USER::ParseStart(const char *el, const char **attr) @@ -658,15 +646,11 @@ userDataCb = data; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_GET_SERVER_INFO::PARSER_GET_SERVER_INFO() + : RecvServerInfoDataCb(NULL), + serverInfoDataCb(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvServerInfoDataCb = NULL; -} -//----------------------------------------------------------------------------- -void PARSER_GET_SERVER_INFO::Reset() -{ - } //----------------------------------------------------------------------------- int PARSER_GET_SERVER_INFO::ParseStart(const char *el, const char **attr) @@ -821,10 +805,11 @@ if (strcmp(attr[0], "value") == 0) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_CHG_USER::PARSER_CHG_USER() + : RecvChgUserCb(NULL), + chgUserCbData(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvChgUserCb = NULL; } //----------------------------------------------------------------------------- int PARSER_CHG_USER::ParseStart(const char *el, const char **attr) @@ -851,11 +836,6 @@ return 0; void PARSER_CHG_USER::ParseEnd(const char *) { depth--; -} -//----------------------------------------------------------------------------- -void PARSER_CHG_USER::Reset() -{ - } //----------------------------------------------------------------------------- void PARSER_CHG_USER::ParseAnswer(const char *, const char **attr) @@ -875,10 +855,11 @@ chgUserCbData = data; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_CHECK_USER::PARSER_CHECK_USER() + : RecvCheckUserCb(NULL), + checkUserCbData(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvCheckUserCb = NULL; } //----------------------------------------------------------------------------- int PARSER_CHECK_USER::ParseStart(const char *el, const char **attr) @@ -917,10 +898,11 @@ checkUserCbData = data; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- PARSER_SEND_MESSAGE::PARSER_SEND_MESSAGE() + : RecvSendMessageCb(NULL), + sendMessageCbData(NULL), + depth(0), + error(false) { -depth = 0; -error = false; -RecvSendMessageCb = NULL; } //----------------------------------------------------------------------------- int PARSER_SEND_MESSAGE::ParseStart(const char *el, const char **attr) @@ -939,11 +921,6 @@ return 0; void PARSER_SEND_MESSAGE::ParseEnd(const char *) { depth--; -} -//----------------------------------------------------------------------------- -void PARSER_SEND_MESSAGE::Reset() -{ - } //----------------------------------------------------------------------------- void PARSER_SEND_MESSAGE::ParseAnswer(const char *, const char **attr) @@ -958,4 +935,3 @@ RecvSendMessageCb = f; sendMessageCbData = data; } //----------------------------------------------------------------------------- - diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index be6fa279..8061d7aa 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -395,4 +395,3 @@ error = 0; return e; } //----------------------------------------------------------------------------- - diff --git a/stglibs/srvconf.lib/servconf.h b/stglibs/srvconf.lib/servconf.h index f3beaec3..874b6ab1 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: @@ -304,6 +292,3 @@ private: //----------------------------------------------------------------------------- #endif /* _SERVCONF_H_ */ - -/* EOF */ -