From af45435014aad8497fbb71d9be53ab3f890a22e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 22 Mar 2019 02:08:51 +0100 Subject: cam: options: Create separate enum for OptionValue types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for support of multiple instances of the same option, create a separate enum for the OptionValue types as it will diverge from enum OptionType. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/options.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cam/options.cpp') diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 655aa36b..49783339 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -248,27 +248,27 @@ void KeyValueParser::usage(int indent) */ OptionValue::OptionValue() - : type_(OptionNone) + : type_(ValueNone) { } OptionValue::OptionValue(int value) - : type_(OptionInteger), integer_(value) + : type_(ValueInteger), integer_(value) { } OptionValue::OptionValue(const char *value) - : type_(OptionString), string_(value) + : type_(ValueString), string_(value) { } OptionValue::OptionValue(const std::string &value) - : type_(OptionString), string_(value) + : type_(ValueString), string_(value) { } OptionValue::OptionValue(const KeyValueParser::Options &value) - : type_(OptionKeyValue), keyValues_(value) + : type_(ValueKeyValue), keyValues_(value) { } @@ -289,7 +289,7 @@ OptionValue::operator KeyValueParser::Options() const int OptionValue::toInteger() const { - if (type_ != OptionInteger) + if (type_ != ValueInteger) return 0; return integer_; @@ -297,7 +297,7 @@ int OptionValue::toInteger() const std::string OptionValue::toString() const { - if (type_ != OptionString) + if (type_ != ValueString) return std::string(); return string_; @@ -305,7 +305,7 @@ std::string OptionValue::toString() const KeyValueParser::Options OptionValue::toKeyValues() const { - if (type_ != OptionKeyValue) + if (type_ != ValueKeyValue) return KeyValueParser::Options(); return keyValues_; -- cgit v1.2.1