diff options
Diffstat (limited to 'src/cam/options.cpp')
-rw-r--r-- | src/cam/options.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 417c3ab4..41968caa 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -17,6 +17,21 @@ * Option */ +struct Option { + int opt; + OptionType type; + const char *name; + OptionArgument argument; + const char *argumentName; + const char *help; + KeyValueParser *keyValueParser; + bool isArray; + + bool hasShortOption() const { return isalnum(opt); } + bool hasLongOption() const { return name != nullptr; } + const char *typeName() const; +}; + const char *Option::typeName() const { switch (type) { @@ -129,6 +144,9 @@ template class OptionsBase<std::string>; * KeyValueParser */ +KeyValueParser::KeyValueParser() = default; +KeyValueParser::~KeyValueParser() = default; + bool KeyValueParser::addOption(const char *name, OptionType type, const char *help, OptionArgument argument) { @@ -349,6 +367,9 @@ std::vector<OptionValue> OptionValue::toArray() const * OptionsParser */ +OptionsParser::OptionsParser() = default; +OptionsParser::~OptionsParser() = default; + bool OptionsParser::addOption(int opt, OptionType type, const char *help, const char *name, OptionArgument argument, const char *argumentName, bool array) |