X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b3139bf3f37b3b0244efea8b4b5e5a7d0bc90095..3829fda4078489c674b3761f296f17cc13cd82d0:/projects/sgconf/options.h?ds=sidebyside diff --git a/projects/sgconf/options.h b/projects/sgconf/options.h index 6b33ee8c..c00707bf 100644 --- a/projects/sgconf/options.h +++ b/projects/sgconf/options.h @@ -50,7 +50,7 @@ class OPTION OPTION & operator=(const OPTION & rhs); void Help(size_t level = 0) const; - PARSER_STATE Parse(int argc, char ** argv); + PARSER_STATE Parse(int argc, char ** argv, void * data); void ParseValue(const std::string & value); bool Check(const char * arg) const; const std::string & Name() const { return m_longName; } @@ -85,7 +85,7 @@ class OPTION_BLOCK void Help(size_t level) const; - PARSER_STATE Parse(int argc, char ** argv); + PARSER_STATE Parse(int argc, char ** argv, void * data = NULL); void ParseFile(const std::string & filePath); class ERROR : public std::runtime_error @@ -107,6 +107,7 @@ class OPTION_BLOCKS public: OPTION_BLOCK & Add(const std::string & description) { m_blocks.push_back(OPTION_BLOCK(description)); return m_blocks.back(); } + void Add(const OPTION_BLOCK & block) { m_blocks.push_back(block); } void Help(size_t level) const; PARSER_STATE Parse(int argc, char ** argv);