More elaborate error reporting

This commit is contained in:
Thomas Krijnen
2016-06-12 11:22:08 +02:00
parent f4fd3a5ca1
commit be10bc46ca
4 changed files with 69 additions and 14 deletions
+18
View File
@@ -22,6 +22,8 @@
#include "IfcParse_Export.h"
#include <boost/lexical_cast.hpp>
#include <exception>
#include <string>
@@ -51,6 +53,22 @@ namespace IfcParse {
: IfcException(e) {}
~IfcAttributeOutOfRangeException () throw () {}
};
class IfcInvalidTokenException : public IfcException {
public:
IfcInvalidTokenException(
int token_start,
const std::string& token_string,
const std::string& expected_type
)
: IfcException(
std::string("Token ") + token_string + " at " +
boost::lexical_cast<std::string>(token_start) +
" invalid " + expected_type
)
{}
~IfcInvalidTokenException() throw () {}
};
}
#ifdef _MSC_VER