git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change %i to %d
[stg.git]
/
projects
/
sgconf
/
options.h
diff --git
a/projects/sgconf/options.h
b/projects/sgconf/options.h
index 3d4bdd64263355211dcaf41ef5539506c777f40d..6b33ee8c2ba263efaa9bb3d3474586b1feb5fd24 100644
(file)
--- a/
projects/sgconf/options.h
+++ b/
projects/sgconf/options.h
@@
-24,6
+24,7
@@
#include <string>
#include <vector>
#include <list>
#include <string>
#include <vector>
#include <list>
+#include <utility>
#include <stdexcept>
#include <cstddef> // size_t
#include <stdexcept>
#include <cstddef> // size_t
@@
-50,7
+51,9
@@
class OPTION
void Help(size_t level = 0) const;
PARSER_STATE Parse(int argc, char ** argv);
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;
bool Check(const char * arg) const;
+ const std::string & Name() const { return m_longName; }
class ERROR : public std::runtime_error
{
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 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<OPTION> m_options;
std::string m_description;
private:
std::vector<OPTION> m_options;
std::string m_description;
+
+ void OptionCallback(const std::string & key, const std::string & value);
};
class OPTION_BLOCKS
};
class OPTION_BLOCKS