X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d625e80d62fc8b98c18a95c65e6fa329b7fcc85b..a3d92499a8c10b231db452e86a0a71900910fa4f:/projects/sgconf/options.h diff --git a/projects/sgconf/options.h b/projects/sgconf/options.h index 3d4bdd64..6b33ee8c 100644 --- a/projects/sgconf/options.h +++ b/projects/sgconf/options.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include // size_t @@ -50,7 +51,9 @@ class OPTION void Help(size_t level = 0) const; PARSER_STATE Parse(int argc, char ** argv); + void ParseValue(const std::string & value); bool Check(const char * arg) const; + const std::string & Name() const { return m_longName; } class ERROR : public std::runtime_error { @@ -83,10 +86,20 @@ class OPTION_BLOCK void Help(size_t level) const; PARSER_STATE Parse(int argc, char ** argv); + void ParseFile(const std::string & filePath); + + class ERROR : public std::runtime_error + { + public: + ERROR(const std::string & message) + : std::runtime_error(message.c_str()) {} + }; private: std::vector