-class PARSER_ADD_TARIFF: public BASE_PARSER {
-public:
- PARSER_ADD_TARIFF() : BASE_PARSER(), tariffToAdd() {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- std::string tariffToAdd;
-
- void CreateAnswer();
-};
-//-----------------------------------------------------------------------------
-class PARSER_DEL_TARIFF: public BASE_PARSER {
-public:
- PARSER_DEL_TARIFF() : BASE_PARSER(), tariffToDel() {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- std::string tariffToDel;
-
- void CreateAnswer();
-};
-//-----------------------------------------------------------------------------
-class PARSER_CHG_TARIFF: public BASE_PARSER {
-public:
- PARSER_CHG_TARIFF() : BASE_PARSER(), td() {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- TARIFF_DATA_RES td;
-
- int ParseSlashedIntParams(int paramsNum, const std::string & s, int * params);
- int ParseSlashedDoubleParams(int paramsNum, const std::string & s, double * params);
- int CheckTariffData();
- int AplayChanges();
- void CreateAnswer();
-};
-//-----------------------------------------------------------------------------/
-class PARSER_ADD_USER: public BASE_PARSER {
-public:
- PARSER_ADD_USER() : BASE_PARSER(), login() {}
- ~PARSER_ADD_USER() {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- std::string login;
-
- int CheckUserData();
- void CreateAnswer();
- void Reset();
-};
-//-----------------------------------------------------------------------------
-class PARSER_CHG_USER: public BASE_PARSER {
-public:
- PARSER_CHG_USER();
- ~PARSER_CHG_USER();
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- USER_STAT_RES * usr;
- USER_CONF_RES * ucr;
- RESETABLE<uint64_t> * upr;
- RESETABLE<uint64_t> * downr;
- std::string cashMsg;
- std::string login;
- bool cashMustBeAdded;
- int res;
-
- PARSER_CHG_USER(const PARSER_CHG_USER & rvalue);
- PARSER_CHG_USER & operator=(const PARSER_CHG_USER & rvalue);
-
- std::string EncChar2String(const char *);
- int AplayChanges();
- void CreateAnswer();
- void Reset();
-};
-//-----------------------------------------------------------------------------
-class PARSER_DEL_USER: public BASE_PARSER {
-public:
- PARSER_DEL_USER() : BASE_PARSER(), res(0), u(NULL) {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- int res;
- USER * u;
-
- PARSER_DEL_USER(const PARSER_DEL_USER & rvalue);
- PARSER_DEL_USER & operator=(const PARSER_DEL_USER & rvalue);
-
- void CreateAnswer();
-};
-//-----------------------------------------------------------------------------
-class PARSER_CHECK_USER: public BASE_PARSER {
-public:
- PARSER_CHECK_USER() : BASE_PARSER() {}
- int ParseStart(void *data, const char *el, const char **attr);
- int ParseEnd(void *data, const char *el);
-
-private:
- void CreateAnswer(const char * error);
-};
-//-----------------------------------------------------------------------------
-class PARSER_SEND_MESSAGE: public BASE_PARSER {
-public:
- 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);
-
-private:
- enum {res_ok, res_params_error, res_unknown};
- std::vector<std::string> logins;
- int result;
- STG_MSG msg;
- USER * u;
-
- PARSER_SEND_MESSAGE(const PARSER_SEND_MESSAGE & rvalue);
- PARSER_SEND_MESSAGE & operator=(const PARSER_SEND_MESSAGE & rvalue);
-
- int ParseLogins(const char * logins);
- void CreateAnswer();
-};