diff options
| author | randomdan <randomdan@localhost> | 2013-12-19 20:41:32 +0000 |
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2013-12-19 20:41:32 +0000 |
| commit | e477f9155f49604dae03b1f299ca91813e426f3f (patch) | |
| tree | 6cb22b5b2cdbc7a823988122d90c929158a957a3 /project2/json/presenter.cpp | |
| parent | Add savepoint support to core DB connector (diff) | |
| download | project2-e477f9155f49604dae03b1f299ca91813e426f3f.tar.bz2 project2-e477f9155f49604dae03b1f299ca91813e426f3f.tar.xz project2-e477f9155f49604dae03b1f299ca91813e426f3f.zip | |
Optimize json objects and output
Diffstat (limited to 'project2/json/presenter.cpp')
| -rw-r--r-- | project2/json/presenter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/project2/json/presenter.cpp b/project2/json/presenter.cpp index 2eabeac..5b769c9 100644 --- a/project2/json/presenter.cpp +++ b/project2/json/presenter.cpp @@ -47,7 +47,7 @@ JsonPresenter::addNamedValue(const Glib::ustring & name, const VariableType & va void JsonPresenter::addValueToObject(const Glib::ustring & name, const VariableType & value) const { - (*curRowSet.top())[name] = json::ValuePtr(new json::Value(boost::apply_visitor(Project2ToJson(), value))); + (*curRowSet.top())[name.collate_key()] = json::ValuePtr(new json::Value(boost::apply_visitor(Project2ToJson(), value))); } void @@ -76,7 +76,7 @@ void JsonPresenter::addNewRowSet(const Glib::ustring & name) const { json::Value * v = new json::Value(json::Object()); - (*curRowSet.top())[name] = json::ValuePtr(v); + (*curRowSet.top())[name.collate_key()] = json::ValuePtr(v); curRowSet.push(boost::get<json::Object>(v)); } @@ -97,7 +97,7 @@ JsonPresenter::addNewArray(const Glib::ustring & name, bool) const { json::Value * v = new json::Value(json::Array()); curRowArray.push(boost::get<json::Array>(v)); - (*curRowSet.top())[name] = json::ValuePtr(v); + (*curRowSet.top())[name.collate_key()] = json::ValuePtr(v); vaStack.push(&JsonPresenter::addValueToArray); } @@ -137,7 +137,7 @@ JsonPresenter::writeTo(std::ostream & o, const std::string & encoding, ExecConte serializeObject(object, o, encoding); } else { - serializeValue(*object[returnObject(ec)], o, encoding); + serializeValue(*object[returnObject(ec).as<Glib::ustring>().collate_key()], o, encoding); } } |
