[DEV] add an object with string creation

This commit is contained in:
Edouard DUPIN 2015-03-12 23:17:14 +01:00
parent 23f4efce84
commit ac16de1c30
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,12 @@
std11::shared_ptr<ejson::Object> ejson::Object::create() {
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() {
m_value.clear();

View File

@ -23,6 +23,7 @@ namespace ejson {
Object() { };
public:
static std11::shared_ptr<Object> create();
static std11::shared_ptr<Object> create(const std::string& _data);
/**
* @brief destructor
*/