diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-06 05:27:18 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-22 17:13:16 +0300 |
commit | 539820f5d63db5e3045306fcdc70d32157fa8b28 (patch) | |
tree | 8c1963b7a8c51f5bd603000b538c4e7b372ebfa4 /src/cam/options.h | |
parent | b9389118842bd09b5b33fc88d8ac79f6462c6961 (diff) |
cam: options: Move OptionValue class after OptionsParser
To prepare for usage of the OptionsParser::Options class in OptionValue,
move the definition of the OptionValue class after OptionsParser. There
is no functional change.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam/options.h')
-rw-r--r-- | src/cam/options.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/cam/options.h b/src/cam/options.h index 688fe260..a3b18bb6 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -74,6 +74,33 @@ private: std::map<std::string, Option> optionsMap_; }; +class OptionsParser +{ +public: + class Options : public OptionsBase<int> + { + }; + + OptionsParser(); + ~OptionsParser(); + + bool addOption(int opt, OptionType type, const char *help, + const char *name = nullptr, + OptionArgument argument = ArgumentNone, + const char *argumentName = nullptr, bool array = false); + bool addOption(int opt, KeyValueParser *parser, const char *help, + const char *name = nullptr, bool array = false); + + Options parse(int argc, char *argv[]); + void usage(); + +private: + void parseValueError(const Option &option); + + std::list<Option> options_; + std::map<unsigned int, Option *> optionsMap_; +}; + class OptionValue { public: @@ -113,31 +140,4 @@ private: std::vector<OptionValue> array_; }; -class OptionsParser -{ -public: - class Options : public OptionsBase<int> - { - }; - - OptionsParser(); - ~OptionsParser(); - - bool addOption(int opt, OptionType type, const char *help, - const char *name = nullptr, - OptionArgument argument = ArgumentNone, - const char *argumentName = nullptr, bool array = false); - bool addOption(int opt, KeyValueParser *parser, const char *help, - const char *name = nullptr, bool array = false); - - Options parse(int argc, char *argv[]); - void usage(); - -private: - void parseValueError(const Option &option); - - std::list<Option> options_; - std::map<unsigned int, Option *> optionsMap_; -}; - #endif /* __CAM_OPTIONS_H__ */ |