From 3fd5ade00c5da727184c6c5aa728d4ee27bb6ac2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 1 Feb 2019 11:26:50 +0200 Subject: cam: options: Add explicit conversion methods to OptionValue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OptionValue class defines operators to convert the variant to all the supported option types. As a convenience, add explicit methods to perform the same operations, avoiding the need to write long static_cast<>() statements in the caller. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/options.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cam/options.h') diff --git a/src/cam/options.h b/src/cam/options.h index e1fd62ec..2d3aa50b 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -91,6 +91,10 @@ public: operator std::string() const; operator KeyValueParser::Options() const; + int toInteger() const; + std::string toString() const; + KeyValueParser::Options toKeyValues() const; + private: OptionType type_; int integer_; -- cgit v1.2.1