[libcamera-devel] [PATCH 04/30] cam: options: Move OptionValue class after OptionsParser
Kieran Bingham
kieran.bingham at ideasonboard.com
Mon Jul 12 15:30:16 CEST 2021
On 07/07/2021 03:19, Laurent Pinchart wrote:
> To prepare for usage of the OptionsParser::Options class in OptionValue,
> move the definition of the OptionValue class after OptionsParser. There
> is not functional change.
s/not/no/
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart 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__ */
>
More information about the libcamera-devel
mailing list