[libcamera-devel] [PATCH v2 01/30] cam: options: Make KeyValueParser::usage() private

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jul 12 23:56:16 CEST 2021


The KeyValueParser::usage() function is meant to be called from an
OptionsParser or another KeyValueParser only. Make it private, and set
the OptionsParser class as a friend of the KeyValueParser class.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/cam/options.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cam/options.h b/src/cam/options.h
index f02eeca2eef9..d0defb4bd665 100644
--- a/src/cam/options.h
+++ b/src/cam/options.h
@@ -79,9 +79,11 @@ public:
 		       OptionArgument argument = ArgumentNone);
 
 	virtual Options parse(const char *arguments);
+
+private:
+	friend class OptionsParser;
 	void usage(int indent);
 
-private:
 	std::map<std::string, Option> optionsMap_;
 };
 
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list