2#ifndef _LOGIT_VARIABLE_VALUE_HPP_INCLUDED
3#define _LOGIT_VARIABLE_VALUE_HPP_INCLUDED
137 template <
typename EnumType>
139 typename std::enable_if<std::is_enum<EnumType>::value>
::type* = 0)
153 if (
this == &other)
return *
this;
226 if (
name.empty())
return false;
227 return !std::isdigit(
static_cast<unsigned char>(
name[0]));
234 template <
typename EnumType>
237 typedef typename std::underlying_type<EnumType>::type UnderlyingType;
238 return std::to_string(
static_cast<UnderlyingType
>(value));
The primary namespace for the LogIt++ library.
std::string format(const char *fmt,...)
Formats a string according to the specified format.
Structure for storing values of various types, including enumerations.
VariableValue(const std::string &name, int8_t value)
VariableValue(const std::string &name, uint64_t value)
VariableValue(const std::string &name, char value)
std::string enum_to_string(EnumType value)
Helper function to convert an enumeration to a string.
std::string name
Variable name.
VariableValue & operator=(const VariableValue &other)
Assignment operator.
VariableValue(const std::string &name, uint32_t value)
VariableValue(const std::string &name, int16_t value)
VariableValue(const std::string &name, float value)
~VariableValue()=default
Destructor.
VariableValue(const std::string &name, int64_t value)
bool is_literal
Flag indicating if the variable is a literal.
std::string to_string() const
Method to get the value as a string.
enum logit::VariableValue::ValueType type
std::string string_value
Variable to store string, exception messages, and enums.
VariableValue(const std::string &name, bool value)
VariableValue(const std::string &name, double value)
VariableValue(const std::string &name, const std::string &value)
VariableValue(const VariableValue &other)
Copy constructor.
ValueType
Enumeration of possible value types.
union logit::VariableValue::@0 pod_value
Union to store POD types.
VariableValue(const std::string &name, EnumType value, typename std::enable_if< std::is_enum< EnumType >::value >::type *=0)
Constructor for enumerations.
VariableValue(const std::string &name, const std::exception &ex)
static bool is_valid_literal_name(const std::string &name)
Helper function to check if a name is a valid literal.
static bool is_pod_type(ValueType type)
Helper function to determine if a ValueType represents a POD type.
VariableValue(const std::string &name, uint16_t value)
VariableValue(const std::string &name, uint8_t value)
std::string to_string(const char *fmt) const
Method to get the value as a formatted string.
VariableValue(const std::string &name, int32_t value)
VariableValue(const std::string &name, const char *value)