cubos::core::reflection::StringConversionTrait class

Stores functions for converting a type to and from a string.

Public types

using Into = std::string(*)(const void*instance)
Function pointer to convert an instance of the type into a string.
using From = bool(*)(void*instance, const std::string&string)
Function pointer to convert a string into an instance of the type.

Constructors, destructors, conversion operators

StringConversionTrait(Into into, From from)
Constructs.

Public functions

auto into(const void* instance) const -> std::string
Converts an instance of the type into a string.
auto from(void* instance, const std::string& string) const -> bool
Converts a string to an instance of the type.

Function documentation

cubos::core::reflection::StringConversionTrait::StringConversionTrait(Into into, From from)

Constructs.

Parameters
into Into.
from From.

std::string cubos::core::reflection::StringConversionTrait::into(const void* instance) const

Converts an instance of the type into a string.

Parameters
instance Instance.
Returns String.

bool cubos::core::reflection::StringConversionTrait::from(void* instance, const std::string& string) const

Converts a string to an instance of the type.

Parameters
instance Instance.
string String.
Returns Whether the string was valid.