summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-09 20:21:45 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-09 20:21:45 +0100
commit99a894683528c6a66853e211ac1aea5f24afd17e (patch)
tree86839f9c77f9bbf97f41d6ab82a99d46e541522f
parentAdd new projects to default build (diff)
downloadslicer-99a894683528c6a66853e211ac1aea5f24afd17e.tar.bz2
slicer-99a894683528c6a66853e211ac1aea5f24afd17e.tar.xz
slicer-99a894683528c6a66853e211ac1aea5f24afd17e.zip
Use libjsonpp stream parser instead of buffering whole file in a ustring
-rw-r--r--slicer/json/serializer.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/slicer/json/serializer.cpp b/slicer/json/serializer.cpp
index f6e7415..7476a0d 100644
--- a/slicer/json/serializer.cpp
+++ b/slicer/json/serializer.cpp
@@ -251,11 +251,7 @@ namespace Slicer {
JsonFileDeserializer::Deserialize(ModelPartPtr modelRoot)
{
std::ifstream inFile(path.string());
- std::stringstream buffer;
- buffer << inFile.rdbuf();
- Glib::ustring doc(buffer.str());
- Glib::ustring::const_iterator itr = doc.begin();
- json::Value obj = json::parseValue(itr);
+ json::Value obj = json::parseValue(inFile);
auto mp = modelRoot->GetAnonChild();
boost::apply_visitor(DocumentTreeIterate(mp), obj);
}