|
|
|
@ -2,7 +2,6 @@ |
|
|
|
#include <string> |
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
|
|
#include <glm/glm.hpp> |
|
|
|
#include <glm/glm.hpp> |
|
|
|
#include <rapidjson/cursorstreamwrapper.h> |
|
|
|
|
|
|
|
#include <rapidjson/document.h> |
|
|
|
#include <rapidjson/document.h> |
|
|
|
#include <rapidjson/schema.h> |
|
|
|
#include <rapidjson/schema.h> |
|
|
|
#include <rapidjson/stringbuffer.h> |
|
|
|
#include <rapidjson/stringbuffer.h> |
|
|
|
@ -325,14 +324,11 @@ loadTextFile(char*& output, const char* data_dir, const char* file_name) |
|
|
|
bool |
|
|
|
bool |
|
|
|
parseFile(rapidjson::Document* doc, const char* file_contents, const char* file_name) |
|
|
|
parseFile(rapidjson::Document* doc, const char* file_contents, const char* file_name) |
|
|
|
{ |
|
|
|
{ |
|
|
|
rapidjson::StringStream ss(file_contents); |
|
|
|
rapidjson::ParseResult pr = doc->Parse(file_contents); |
|
|
|
rapidjson::CursorStreamWrapper<rapidjson::StringStream> csw(ss); |
|
|
|
|
|
|
|
rapidjson::ParseResult pr = doc->ParseStream(csw); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!pr || !doc->IsObject()) { |
|
|
|
if (!pr || !doc->IsObject()) { |
|
|
|
LOG(ERROR) << "Error parrsing json file: " << file_name; |
|
|
|
LOG(ERROR) << "Error parrsing json file: " << file_name; |
|
|
|
LOG(ERROR) << " at line " << csw.GetLine() << ", col " << csw.GetColumn() << "\n"; |
|
|
|
LOG(ERROR) << ". Error desscription: " << rapidjson::GetParseError_En(pr.Code()) |
|
|
|
LOG(ERROR) << "Error desscription: " << rapidjson::GetParseError_En(pr.Code()) |
|
|
|
|
|
|
|
<< " (" << pr.Offset() << ")\n"; |
|
|
|
<< " (" << pr.Offset() << ")\n"; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|