X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/7df336e60c959c440b2c330f7a7ca9b0251db2a1..f7b9fd9ef231946b4a1e5edf54c187e7ddbed8fe:/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h?ds=inline diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h b/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h index c68789c2..70ae0274 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h @@ -24,6 +24,7 @@ #include "parser.h" +#include "stg/common.h" #include "stg/resetable.h" #include @@ -42,10 +43,10 @@ class GET_ADMINS: public BASE_PARSER class FACTORY : public BASE_PARSER::FACTORY { public: - FACTORY(const ADMINS & admins) : m_admins(admins) {} + explicit FACTORY(const ADMINS & admins) : m_admins(admins) {} virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_ADMINS(admin, m_admins); } static void Register(REGISTRY & registry, const ADMINS & admins) - { registry[tag] = new FACTORY(admins); } + { registry[ToLower(tag)] = new FACTORY(admins); } private: const ADMINS & m_admins; }; @@ -67,10 +68,10 @@ class ADD_ADMIN: public BASE_PARSER class FACTORY : public BASE_PARSER::FACTORY { public: - FACTORY(ADMINS & admins) : m_admins(admins) {} + explicit FACTORY(ADMINS & admins) : m_admins(admins) {} virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_ADMIN(admin, m_admins); } static void Register(REGISTRY & registry, ADMINS & admins) - { registry[tag] = new FACTORY(admins); } + { registry[ToLower(tag)] = new FACTORY(admins); } private: ADMINS & m_admins; }; @@ -94,10 +95,10 @@ class DEL_ADMIN: public BASE_PARSER class FACTORY : public BASE_PARSER::FACTORY { public: - FACTORY(ADMINS & admins) : m_admins(admins) {} + explicit FACTORY(ADMINS & admins) : m_admins(admins) {} virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_ADMIN(admin, m_admins); } static void Register(REGISTRY & registry, ADMINS & admins) - { registry[tag] = new FACTORY(admins); } + { registry[ToLower(tag)] = new FACTORY(admins); } private: ADMINS & m_admins; }; @@ -121,10 +122,10 @@ class CHG_ADMIN: public BASE_PARSER class FACTORY : public BASE_PARSER::FACTORY { public: - FACTORY(ADMINS & admins) : m_admins(admins) {} + explicit FACTORY(ADMINS & admins) : m_admins(admins) {} virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_ADMIN(admin, m_admins); } static void Register(REGISTRY & registry, ADMINS & admins) - { registry[tag] = new FACTORY(admins); } + { registry[ToLower(tag)] = new FACTORY(admins); } private: ADMINS & m_admins; };