X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e5499c61083684b28bcbc6950aae66cbf0938703..e9ae1f101b5418c0ba2e6c9d86b23c12f0140982:/sgconf/actions.h diff --git a/sgconf/actions.h b/sgconf/actions.h index 69407de2..3181a105 100644 --- a/sgconf/actions.h +++ b/sgconf/actions.h @@ -18,15 +18,14 @@ * Author : Maxim Mamontov */ -#ifndef __STG_SGCONF_ACTIONS_H__ -#define __STG_SGCONF_ACTIONS_H__ +#pragma once #include "action.h" #include "options.h" #include "parser_state.h" #include "stg/common.h" -#include "stg/resetable.h" +#include "stg/optional.h" #include @@ -70,7 +69,7 @@ template class PARAM_ACTION : public ACTION { public: - PARAM_ACTION(RESETABLE & param, + PARAM_ACTION(STG::Optional & param, const T & defaultValue, const std::string & paramDescription) : m_param(param), @@ -78,11 +77,11 @@ class PARAM_ACTION : public ACTION m_description(paramDescription), m_hasDefault(true) {} - PARAM_ACTION(RESETABLE & param) + PARAM_ACTION(STG::Optional & param) : m_param(param), m_hasDefault(false) {} - PARAM_ACTION(RESETABLE & param, + PARAM_ACTION(STG::Optional & param, const std::string & paramDescription) : m_param(param), m_description(paramDescription), @@ -98,7 +97,7 @@ class PARAM_ACTION : public ACTION virtual void ParseValue(const std::string & value); private: - RESETABLE & m_param; + STG::Optional & m_param; T m_defaltValue; std::string m_description; bool m_hasDefault; @@ -177,7 +176,7 @@ return PARSER_STATE(false, --argc, ++argv); template inline -PARAM_ACTION * MakeParamAction(RESETABLE & param, +PARAM_ACTION * MakeParamAction(STG::Optional & param, const T & defaultValue, const std::string & paramDescription) { @@ -186,14 +185,14 @@ return new PARAM_ACTION(param, defaultValue, paramDescription); template inline -PARAM_ACTION * MakeParamAction(RESETABLE & param) +PARAM_ACTION * MakeParamAction(STG::Optional & param) { return new PARAM_ACTION(param); } template inline -PARAM_ACTION * MakeParamAction(RESETABLE & param, +PARAM_ACTION * MakeParamAction(STG::Optional & param, const std::string & paramDescription) { return new PARAM_ACTION(param, paramDescription); @@ -242,5 +241,3 @@ return new KV_ACTION(name, paramDescription); } } // namespace SGCONF - -#endif