summaryrefslogtreecommitdiff
path: root/src/cam/options.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-02-01 11:26:50 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-02-01 11:42:10 +0200
commit3fd5ade00c5da727184c6c5aa728d4ee27bb6ac2 (patch)
treebc919a065b10c5eff452e1d3aa37f146ae6d1e7a /src/cam/options.h
parent86a7b45bdb5221b7ef8a293b8a501be3296a84b8 (diff)
cam: options: Add explicit conversion methods to OptionValue
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/cam/options.h')
-rw-r--r--src/cam/options.h4
1 files changed, 4 insertions, 0 deletions
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_;