Uranus  1.0.1.0
Uranus is a GameEngine written in C++
Loading...
Searching...
No Matches
tson::Property Class Reference
Collaboration diagram for tson::Property:
[legend]

Public Member Functions

 Property (IJson &json, tson::Project *project=nullptr)
 
 Property (std::string name, std::any value, Type type)
 
const std::string & getName () const
 
const std::string & getPropertyType () const
 
Type getType () const
 
const std::any & getValue () const
 
template<typename T >
getValue () const
 
const std::type_info & getValueType () const
 
std::string getValueTypeInfo ()
 
void setName (const std::string &name)
 
void setStrValue (const std::string &value)
 
void setValue (const std::any &value)
 
void setValueByType (IJson &json)
 

Protected Member Functions

void setTypeByString (const std::string &str)
 

Protected Attributes

std::string m_name {}
 
tson::Projectm_project = nullptr
 
std::string m_propertyType {}
 
Type m_type = Type::Undefined
 
std::any m_value
 

Member Function Documentation

◆ getValueType()

const std::type_info & tson::Property::getValueType ( ) const
inline

Gets the value type as std::value_info. This can easily be compared to types like this: Check if int: getValueType() == typeid(int)

Returns

◆ getValueTypeInfo()

std::string tson::Property::getValueTypeInfo ( )
inline

Gets the value type as std::string Examples of known types: "i" = int "f" = float "b" = bool

Returns

◆ setStrValue()

void tson::Property::setStrValue ( const std::string &  value)
inline

Sets the value specifically as string. When not specified as std::string, the default is that the value will be set as char * when adding a value like "test" This function is to make sure the value is added as string.

Parameters
value

The documentation for this class was generated from the following file: