From e6b216fb77418ffcce152ae7dbf54808c49b8b09 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Fri, 29 May 2015 11:40:04 +0200 Subject: [PATCH] Fixed a bug in Collada importer - it didn't take tabs as whitespace. Also greatly improved the exceptions that are thrown if invalid characters are encountered. --- StringHelper.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/StringHelper.h b/StringHelper.h index f28733a..63e5911 100755 --- a/StringHelper.h +++ b/StringHelper.h @@ -32,6 +32,7 @@ #include #include #include +#include #include "vec3.h" #include "mat4.h" @@ -72,6 +73,7 @@ class StringHelper delims.push_back(' '); delims.push_back('\n'); delims.push_back('\r'); + delims.push_back('\t'); std::vector tarray; std::string str=""; int slen = string.length(); @@ -84,8 +86,14 @@ class StringHelper tarray.push_back(f); str = ""; } - else - throw 1; + else { + std::stringstream ss; + ss << "COLLADA import error: the following string cannot be parsed as array element: '"; + ss << str << "', with ASCII codes "; + for (int j=0; j