[libcamera-devel] [PATCH v3 04/33] cam: options: Move OptionValue class after OptionsParser
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Jul 15 23:14:30 CEST 2021
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 at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
src/cam/options.h | 54 +++++++++++++++++++++++------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/cam/options.h b/src/cam/options.h
index 688fe26011f8..a3b18bb6c4ea 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__ */
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list