Class Varying
Defined in File varying.h
Nested Relationships
Nested Types
Class Documentation
-
class Varying
Public Types
-
template<typename T>
using SignedIntegerType = typename std::enable_if_t<IsSignedInteger<T>::value, T>
-
template<typename T>
using UnsignedIntegerType = typename std::enable_if_t<IsUnsignedInteger<T>::value, T>
-
template<typename T>
using UserDataType = typename std::enable_if_t<IsUserData<T>::value, T>
Public Functions
-
template<typename T>
inline explicit Varying(const T &value) Generalized constructor for bool, integral- and float-types. This constructor has been specialized for std::string and std::vector<std::byte>.
-
explicit Varying(const std::vector<std::byte> &value)
Constructor for an arbitrary sequence of bytes value.
-
explicit Varying(const std::string &value)
Constructor for a string value.
-
inline explicit Varying(const char *value)
Constructor for a string literal value.
-
Varying &operator=(const std::vector<std::byte> &value)
Assigns an arbitrary sequence of bytes value.
-
template<typename T, std::enable_if_t<IsBool<T>::value, bool> = true>
inline Varying &operator=(const T &value) Assigns a bool value.
-
template<typename T, std::enable_if_t<IsInteger<T>::value, bool> = true>
inline Varying &operator=(const T &value) Assigns an integer value.
-
template<typename T, std::enable_if_t<IsFloat<T>::value, bool> = true>
inline Varying &operator=(const T &value) Assign a floating point value.
-
template<typename T>
inline StringType<T> GetValue() const Returns a string if able.
-
template<typename T>
inline SignedIntegerType<T> GetValue() const Returns a signed integer if able.
-
template<typename T>
inline UnsignedIntegerType<T> GetValue() const Returns an unsigned integer if able.
-
template<typename T>
inline UserDataType<T> GetValue() const Returns user data if able.
-
std::string GetStringValue() const
Returns the string value if valid. Otherwise throws std::logic_error.
-
bool GetBoolValue() const
Returns the bool value if valid. Otherwise throws std::logic_error.
-
int64_t GetIntegerValue() const
Returns the integer value if valid. Otherwise throws std::logic_error.
-
double GetFloatValue() const
Returns the float value if valid. Otherwise throws std::logic_error.
-
size_t GetByteSize() const
Returns the raw byte size associated with the type.
-
inline VaryingDataType GetType() const
Returns the current-type of the variable.
-
inline std::string GetTypeName() const
Returns the string type name of the type.
-
std::string PrintStr(bool with_type = true) const
Returns a string value for the value.
-
~Varying() = default
Public Static Functions
-
static inline std::unique_ptr<VaryingType> Helper(const bool &value)
-
static inline std::unique_ptr<VaryingType> Helper(const int64_t &value)
-
static inline std::unique_ptr<VaryingType> Helper(const double &value)
-
static inline std::unique_ptr<VaryingType> Helper(const Vector3 &value)
-
template<typename T>
struct IsSignedInteger
-
template<typename T>
struct IsUnsignedInteger
-
template<typename T>