[DEV] add an object with string creation
This commit is contained in:
parent
23f4efce84
commit
ac16de1c30
@ -24,6 +24,12 @@
|
|||||||
std11::shared_ptr<ejson::Object> ejson::Object::create() {
|
std11::shared_ptr<ejson::Object> ejson::Object::create() {
|
||||||
return std11::shared_ptr<ejson::Object>(new ejson::Object());
|
return std11::shared_ptr<ejson::Object>(new ejson::Object());
|
||||||
}
|
}
|
||||||
|
std11::shared_ptr<ejson::Object> ejson::Object::create(const std::string& _data) {
|
||||||
|
ejson::Document doc;
|
||||||
|
doc.parse(_data);
|
||||||
|
return doc.cloneObj();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ejson::Object::clear() {
|
void ejson::Object::clear() {
|
||||||
m_value.clear();
|
m_value.clear();
|
||||||
|
@ -23,6 +23,7 @@ namespace ejson {
|
|||||||
Object() { };
|
Object() { };
|
||||||
public:
|
public:
|
||||||
static std11::shared_ptr<Object> create();
|
static std11::shared_ptr<Object> create();
|
||||||
|
static std11::shared_ptr<Object> create(const std::string& _data);
|
||||||
/**
|
/**
|
||||||
* @brief destructor
|
* @brief destructor
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user