#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"
std::string password;
double cash;
double credit;
+ time_t creditExpire;
double lastCash;
double prepaidTraff;
int down;
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);
RecvServerInfoDataCb_t RecvServerInfoDataCb;
void * serverInfoDataCb;
- USERDATA user;
int depth;
bool error;
SERVERINFO serverInfo;
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:
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);
NETTRANSACT nt;
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;
//-----------------------------------------------------------------------------
#endif /* _SERVCONF_H_ */
-
-/* EOF */
-