X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1b2ab8e6d556a8ed30d4feadc72263b3f4c86665..58c44b8153f2164b07be44e463bf7b92044098bd:/projects/stargazer/plugins/configuration/sgconfig/parser.h?ds=inline diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser.h b/projects/stargazer/plugins/configuration/sgconfig/parser.h index e76d8f4c..b991a807 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser.h +++ b/projects/stargazer/plugins/configuration/sgconfig/parser.h @@ -15,7 +15,6 @@ #include "stg/users.h" #include "stg/message.h" -#include #include #include @@ -33,14 +32,12 @@ public: store(NULL), settings(NULL), currAdmin(NULL), - depth(0), - answerList(NULL) + depth(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; - - void SetAnswerList(std::list * ansList) { answerList = ansList; } + virtual void Reset() { answer.clear(); depth = 0; } void SetUsers(USERS * u) { users = u; } void SetAdmins(ADMINS * a) { admins = a; } @@ -49,8 +46,8 @@ public: void SetStgSettings(const SETTINGS * s) { settings = s; } void SetCurrAdmin(ADMIN & cua) { currAdmin = &cua; } - std::string & GetStrError() { return strError; } - void Reset() { answerList->clear(); depth = 0; } + const std::string & GetStrError() const { return strError; } + const std::string & GetAnswer() const { return answer; } protected: BASE_PARSER(const BASE_PARSER & rvalue); @@ -64,7 +61,7 @@ protected: const SETTINGS * settings; ADMIN * currAdmin; int depth; - std::list * answerList; + std::string answer; }; //----------------------------------------------------------------------------- class PARSER_GET_ADMINS: public BASE_PARSER { @@ -97,7 +94,6 @@ public: private: std::string adminToDel; - int CheckAttr(const char **attr); void CreateAnswer(); }; //-----------------------------------------------------------------------------