Variant for CustomValue.
More...
#include <libCZI_Metadata.h>
|
| CustomValueVariant () |
| Default constructor - setting the variant to 'invalid'.
|
|
| CustomValueVariant (std::int32_t v) |
|
| CustomValueVariant (double v) |
|
| CustomValueVariant (float v) |
|
| CustomValueVariant (bool v) |
|
| CustomValueVariant (const std::string &v) |
|
| CustomValueVariant (const char *string) |
|
void | SetInt32 (std::int32_t v) |
|
void | SetDouble (double v) |
|
void | SetFloat (float v) |
|
void | SetBool (bool v) |
|
void | SetString (const std::string &v) |
|
std::int32_t | GetAsInt32OrThrow () const |
| Returns integer value if ValueType is int, otherwise throws a RuntimeError.
|
|
double | GetAsDoubleOrThrow () const |
| Returns double value if ValueType is double, otherwise throws a RuntimeError.
|
|
float | GetAsFloatOrThrow () const |
| Returns float value if ValueType is 'Float', otherwise throws a RuntimeError.
|
|
bool | GetAsBoolOrThrow () const |
| Returns boolean value if ValueType is boolean, otherwise throws a RuntimeError.
|
|
std::string | GetAsStringOrThrow () const |
| Returns string value if ValueType is string, otherwise throws a RuntimeError.
|
|
Type | GetType () const |
| Returns ValueType.
|
|
◆ Type
Values that represent the type represented by this variant.
Enumerator |
---|
Invalid | An enum constant representing the 'invalid' type (would throw an invalid-argument-exception).
|
Int32 | An enum constant representing the 'signed 32-bit integer' type.
|
Float | An enum constant representing the 'float' type.
|
Double | An enum constant representing the 'double' type.
|
Boolean | An enum constant representing the 'boolean' type.
|
String | An enum constant representing the 'string' type.
|
◆ CustomValueVariant() [1/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
std::int32_t |
v | ) |
|
|
inlineexplicit |
Constructor for initializing the 'int32' type.
- Parameters
-
v | The value to set the variant to. |
◆ CustomValueVariant() [2/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
double |
v | ) |
|
|
inlineexplicit |
Constructor for initializing the 'double' type.
- Parameters
-
v | The value to set the variant to. |
◆ CustomValueVariant() [3/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
float |
v | ) |
|
|
inlineexplicit |
Constructor for initializing the 'float' type.
- Parameters
-
v | The value to set the variant to. |
◆ CustomValueVariant() [4/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
bool |
v | ) |
|
|
inlineexplicit |
Constructor for initializing the 'bool' type.
- Parameters
-
v | The value to set the variant to. |
◆ CustomValueVariant() [5/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
const std::string & |
v | ) |
|
|
inlineexplicit |
Constructor for initializing the 'string' type.
- Parameters
-
v | The value to set the variant to. |
◆ CustomValueVariant() [6/6]
libCZI::CustomValueVariant::CustomValueVariant |
( |
const char * |
string | ) |
|
|
inlineexplicit |
Constructor for initializing the 'string' type.
- Parameters
-
string | The value to set the variant to. |
◆ SetBool()
void libCZI::CustomValueVariant::SetBool |
( |
bool |
v | ) |
|
|
inline |
Sets the type of the variant to "Boolean" and the value to the specified value.
- Parameters
-
◆ SetDouble()
void libCZI::CustomValueVariant::SetDouble |
( |
double |
v | ) |
|
|
inline |
Sets the type of the variant to "Double" and the value to the specified value.
- Parameters
-
◆ SetFloat()
void libCZI::CustomValueVariant::SetFloat |
( |
float |
v | ) |
|
|
inline |
Sets the type of the variant to "Float" and the value to the specified value.
- Parameters
-
◆ SetInt32()
void libCZI::CustomValueVariant::SetInt32 |
( |
std::int32_t |
v | ) |
|
|
inline |
Sets the type of the variant to "Int32" and the value to the specified value.
- Parameters
-
◆ SetString()
void libCZI::CustomValueVariant::SetString |
( |
const std::string & |
v | ) |
|
|
inline |
Sets the type of the variant to "String" and the value to the specified value.
- Parameters
-
The documentation for this struct was generated from the following file: