virtual ~BASE_PARSER() {}
virtual int ParseStart(void *data, const char *el, const char **attr) = 0;
virtual int ParseEnd(void *data, const char *el) = 0;
virtual ~BASE_PARSER() {}
virtual int ParseStart(void *data, const char *el, const char **attr) = 0;
virtual int ParseEnd(void *data, const char *el) = 0;
virtual void SetCurrAdmin(ADMIN & cua) { currAdmin = &cua; }
virtual std::string & GetStrError() { return strError; }
virtual void Reset() { answerList->clear(); depth = 0; }
virtual void SetCurrAdmin(ADMIN & cua) { currAdmin = &cua; }
virtual std::string & GetStrError() { return strError; }
virtual void Reset() { answerList->clear(); depth = 0; }
//-----------------------------------------------------------------------------
class PARSER_ADD_ADMIN: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_ADD_ADMIN: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_DEL_ADMIN: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_DEL_ADMIN: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_CHG_ADMIN: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_CHG_ADMIN: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_GET_USER: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_GET_USER: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_GET_USERS: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_GET_USERS: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_ADD_TARIFF: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_ADD_TARIFF: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_DEL_TARIFF: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_DEL_TARIFF: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------
class PARSER_CHG_TARIFF: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_CHG_TARIFF: public BASE_PARSER {
public:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
//-----------------------------------------------------------------------------/
class PARSER_ADD_USER: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------/
class PARSER_ADD_USER: public BASE_PARSER {
public:
~PARSER_ADD_USER() {}
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
~PARSER_ADD_USER() {}
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
//-----------------------------------------------------------------------------
class PARSER_SEND_MESSAGE: public BASE_PARSER {
public:
//-----------------------------------------------------------------------------
class PARSER_SEND_MESSAGE: public BASE_PARSER {
public:
- PARSER_SEND_MESSAGE() : BASE_PARSER(), result(0), u(NULL) {}
+ PARSER_SEND_MESSAGE() : BASE_PARSER(), logins(), result(0), msg(), u(NULL) {}
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
private:
int ParseStart(void *data, const char *el, const char **attr);
int ParseEnd(void *data, const char *el);
void CreateAnswer();
private:
int ParseLogins(const char * logins);
enum {res_ok, res_params_error, res_unknown};
int ParseLogins(const char * logins);
enum {res_ok, res_params_error, res_unknown};