Switchboard SDK
Loading...
Searching...
No Matches
switchboard::AnyValue Struct Reference

Static Public Member Functions

static bool toBool (const std::any &value)
static int toInt (const std::any &value)
static unsigned int toUInt (const std::any &value)
static float toFloat (const std::any &value)
static double toDouble (const std::any &value)
static std::string toString (const std::any &value)
template<typename T>
static std::vector< T > toVector (const std::any &value)

Member Function Documentation

◆ toBool()

bool switchboard::AnyValue::toBool ( const std::any & value)
static

Converts an any value to a boolean.

Parameters
valueThe value.
Returns
The boolean representation of the value.

◆ toDouble()

double switchboard::AnyValue::toDouble ( const std::any & value)
static

Converts an any value to a double.

Parameters
valueThe value.
Returns
The double representation of the value.

◆ toFloat()

float switchboard::AnyValue::toFloat ( const std::any & value)
static

Converts an any value to a float.

Parameters
valueThe value.
Returns
The float representation of the value.

◆ toInt()

int switchboard::AnyValue::toInt ( const std::any & value)
static

Converts an any value to an integer.

Parameters
valueThe value.
Returns
The integer representation of the value.

◆ toString()

std::string switchboard::AnyValue::toString ( const std::any & value)
static

Converts an any value to a string. Supports both std::string and const char*.

Parameters
valueThe value.
Returns
The string representation of the value.

◆ toUInt()

unsigned int switchboard::AnyValue::toUInt ( const std::any & value)
static

Converts an any value to an unsigned integer.

Parameters
valueThe value.
Returns
The unsigned integer representation of the value.

◆ toVector()

template<typename T>
template std::vector< Config > switchboard::AnyValue::toVector< Config > ( const std::any & value)
static

Converts an any value to a vector.

Template Parameters
TThe type of the vector.
Parameters
valueThe value.
Returns
The vector representation of the value.