From cdd6c43fceeb5a37867ae902bb71429abad7fa64 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 8 Dec 2010 16:28:52 +0200 Subject: [PATCH] =?utf8?q?=D0=92=20=D0=BF=D0=B0=D1=80=D1=81=D0=B5=D1=80?= =?utf8?q?=D0=B0=D1=85=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5?= =?utf8?q?=D0=BA=D0=B8=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?utf8?q?=D0=B8=20=D0=BF=D1=80=D0=BE=D1=82=D0=BE=D0=BA=D0=BE=D0=BB=D0=B0?= =?utf8?q?=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=82?= =?utf8?q?=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?utf8?q?=D1=82=D0=BE=D1=80=D1=8B,=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D0=B4?= =?utf8?q?=D0=B5=D0=BD=D0=B0=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB?= =?utf8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=87=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=BE=D0=B2,=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BD?= =?utf8?q?=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?utf8?q?=D0=BC=D1=8B=D0=B5=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- stglibs/srvconf.lib/parser.cpp | 72 +++++++++++--------------------- stglibs/srvconf.lib/servconf.cpp | 1 - stglibs/srvconf.lib/servconf.h | 25 +++-------- 3 files changed, 29 insertions(+), 69 deletions(-) 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 */ - -- 2.44.2