X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2Fexception.cxx;h=082d12e4ef782558b15c4e7c76f602f36b5f17a0;hb=b2c3a90adfb6c0285d02355fd8ab061b7f2f1e6c;hp=accd9706c264dc19f2e8d9dd836c7ce9444b10f2;hpb=9cbbe5559844317f44744788ddb308101a1e75e9;p=simgear.git diff --git a/simgear/structure/exception.cxx b/simgear/structure/exception.cxx index accd9706..082d12e4 100644 --- a/simgear/structure/exception.cxx +++ b/simgear/structure/exception.cxx @@ -6,10 +6,13 @@ #include "exception.hxx" + #include #include #include +#include + using std::string; //////////////////////////////////////////////////////////////////////// @@ -24,7 +27,7 @@ sg_location::sg_location () _path[0] = '\0'; } -sg_location::sg_location (const string& path, int line, int column) +sg_location::sg_location (const std::string& path, int line, int column) : _line(line), _column(column), _byte(-1) @@ -97,7 +100,7 @@ sg_location::setByte (int byte) _byte = byte; } -string +std::string sg_location::asString () const { std::ostringstream out; @@ -260,6 +263,20 @@ sg_io_exception::sg_io_exception (const string& message, const string& origin) { } +sg_io_exception::sg_io_exception (const string& message, + const sg_location &location, + const string& origin) + : sg_exception(message, origin), + _location(location) +{ +} + +sg_io_exception::sg_io_exception (const string &message, const SGPath& origin) + : sg_exception(message, origin.str()) +{ + +} + sg_io_exception::~sg_io_exception () throw () { }