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)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
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)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
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)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
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)
void PARSER_CHG_USER::ParseEnd(const char *)
{
depth--;
-}
-//-----------------------------------------------------------------------------
-void PARSER_CHG_USER::Reset()
-{
-
}
//-----------------------------------------------------------------------------
void PARSER_CHG_USER::ParseAnswer(const char *, const char **attr)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
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)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
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)
void PARSER_SEND_MESSAGE::ParseEnd(const char *)
{
depth--;
-}
-//-----------------------------------------------------------------------------
-void PARSER_SEND_MESSAGE::Reset()
-{
-
}
//-----------------------------------------------------------------------------
void PARSER_SEND_MESSAGE::ParseAnswer(const char *, const char **attr)
sendMessageCbData = data;
}
//-----------------------------------------------------------------------------
-
#ifndef SERVCONF_H
#define SERVCONF_H
-#include "os_int.h"
-
#include <expat.h>
+
#include <list>
#include <string>
+
+#include "os_int.h"
#include "netunit.h"
#include "stg_const.h"
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
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:
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:
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;
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);
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);
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:
//-----------------------------------------------------------------------------
#endif /* _SERVCONF_H_ */
-
-/* EOF */
-