X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d625e80d62fc8b98c18a95c65e6fa329b7fcc85b..8bfc0bdce2bf4f53ac2c072e7a44e9a7d3b3cca8:/projects/sgconf/action.h?ds=sidebyside diff --git a/projects/sgconf/action.h b/projects/sgconf/action.h index 64d7c1e8..bd3555ed 100644 --- a/projects/sgconf/action.h +++ b/projects/sgconf/action.h @@ -18,10 +18,10 @@ * Author : Maxim Mamontov */ -#ifndef __STG_SGCONF_ACTION_H__ -#define __STG_SGCONF_ACTION_H__ +#pragma once #include +#include #include namespace SGCONF @@ -29,33 +29,24 @@ namespace SGCONF class OPTION_BLOCK; struct PARSER_STATE; +struct CONFIG; class ACTION { public: virtual ~ACTION() {} - virtual ACTION * Clone() const = 0; virtual std::string ParamDescription() const = 0; virtual std::string DefaultDescription() const = 0; virtual OPTION_BLOCK & Suboptions() = 0; - virtual PARSER_STATE Parse(int argc, char ** argv) = 0; + virtual PARSER_STATE Parse(int argc, char ** argv, void * data = NULL) = 0; + virtual void ParseValue(const std::string &) {} - class ERROR : public std::runtime_error + struct ERROR : std::runtime_error { - public: - ERROR(const std::string & message) - : std::runtime_error(message.c_str()) {} + explicit ERROR(const std::string & message) + : std::runtime_error(message.c_str()) {} }; }; -template -class ACTION_CLONE_MIXIN : public ACTION -{ - public: - virtual ACTION * Clone() const { return new T(*this); } -}; - } // namespace SGCONF - -#endif