From 812e5a946fb74609376f2c72972ec8c86a84a19e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 15 Jul 2021 22:54:05 +0300 Subject: cam: options: Add empty() function to OptionValue class Add a convenience helper to check if an option value is empty, based on the value type. This is useful as a shortcut syntax to check if an option has been set. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/cam/options.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/cam/options.cpp') diff --git a/src/cam/options.cpp b/src/cam/options.cpp index fda6d976..481ac189 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -583,6 +583,13 @@ void OptionValue::addValue(const OptionValue &value) * \return The value type */ +/** + * \fn OptionValue::empty() + * \brief Check if the value is empty + * \return True if the value is empty (type set to ValueType::ValueNone), or + * false otherwise + */ + /** * \brief Cast the value to an int * \return The option value as an int, or 0 if the value type isn't -- cgit v1.2.1