From 99a894683528c6a66853e211ac1aea5f24afd17e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 9 Oct 2015 20:21:45 +0100 Subject: Use libjsonpp stream parser instead of buffering whole file in a ustring --- slicer/json/serializer.cpp | 6 +----- 1 file changed, 1 insertion(+), 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); } -- cgit v1.2.3