Added contructor with Json::Value and operator Json::Value() to Entity
This commit is contained in:
parent
cc43f133a4
commit
1f36568b20
|
@ -333,6 +333,15 @@ public:
|
||||||
*/
|
*/
|
||||||
explicit Entity(const string &json);
|
explicit Entity(const string &json);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Constructs an Entity object from a JSON object.
|
||||||
|
*
|
||||||
|
* @param object JSON object
|
||||||
|
*
|
||||||
|
* @since 0.100.0
|
||||||
|
*/
|
||||||
|
explicit Entity(const Json::Value &object);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Constructs an empty Entity object.
|
* @brief Constructs an empty Entity object.
|
||||||
*
|
*
|
||||||
|
@ -347,6 +356,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual ~Entity();
|
virtual ~Entity();
|
||||||
|
|
||||||
|
operator const Json::Value() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Replaces the Entity with a new one from a JSON string.
|
* @brief Replaces the Entity with a new one from a JSON string.
|
||||||
*
|
*
|
||||||
|
|
|
@ -33,6 +33,11 @@ Easy::Entity::Entity(const string &json)
|
||||||
from_string(json);
|
from_string(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Easy::Entity::Entity(const Json::Value &object)
|
||||||
|
: _tree(object)
|
||||||
|
,_was_set(false)
|
||||||
|
{}
|
||||||
|
|
||||||
Easy::Entity::Entity()
|
Easy::Entity::Entity()
|
||||||
: _was_set(false)
|
: _was_set(false)
|
||||||
{}
|
{}
|
||||||
|
@ -40,6 +45,11 @@ Easy::Entity::Entity()
|
||||||
Easy::Entity::~Entity()
|
Easy::Entity::~Entity()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Easy::Entity::operator const Json::Value() const
|
||||||
|
{
|
||||||
|
return to_object();
|
||||||
|
}
|
||||||
|
|
||||||
void Easy::Entity::from_string(const string &json)
|
void Easy::Entity::from_string(const string &json)
|
||||||
{
|
{
|
||||||
std::stringstream ss(json);
|
std::stringstream ss(json);
|
||||||
|
|
Reference in New Issue