X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d084d9ae9f7bcd7f7d1926e7eeae921dbad49273..159aab3687fe110f9a4d80a3d9fc9805ef09f51b:/projects/sgconf/actions.h?ds=sidebyside diff --git a/projects/sgconf/actions.h b/projects/sgconf/actions.h index 07bcfb8b..08dc177e 100644 --- a/projects/sgconf/actions.h +++ b/projects/sgconf/actions.h @@ -78,6 +78,10 @@ class PARAM_ACTION : public ACTION m_description(paramDescription), m_hasDefault(true) {} + PARAM_ACTION(RESETABLE & param) + : m_param(param), + m_hasDefault(false) + {} PARAM_ACTION(RESETABLE & param, const std::string & paramDescription) : m_param(param), @@ -132,6 +136,14 @@ m_param = value; return PARSER_STATE(false, --argc, ++argv); } +template <> +inline +PARSER_STATE PARAM_ACTION::Parse(int argc, char ** argv, void * /*data*/) +{ +m_param = true; +return PARSER_STATE(false, argc, argv); +} + template inline void PARAM_ACTION::ParseValue(const std::string & stringValue) @@ -172,6 +184,13 @@ PARAM_ACTION * MakeParamAction(RESETABLE & param, return new PARAM_ACTION(param, defaultValue, paramDescription); } +template +inline +PARAM_ACTION * MakeParamAction(RESETABLE & param) +{ +return new PARAM_ACTION(param); +} + template inline PARAM_ACTION * MakeParamAction(RESETABLE & param,