| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "anki/util/scanner/Exception.h"
- #include <boost/lexical_cast.hpp>
- namespace scanner {
- //==============================================================================
- // Constructor =
- //==============================================================================
- Exception::Exception(const std::string& err, int errNo_,
- const std::string& scriptFilename_, int scriptLineNmbr_)
- : error(err),
- errNo(errNo_),
- scriptFilename(scriptFilename_),
- scriptLineNmbr(scriptLineNmbr_)
- {}
- //==============================================================================
- // Copy constructor =
- //==============================================================================
- Exception::Exception(const Exception& e)
- : error(e.error),
- errNo(e.errNo),
- scriptFilename(e.scriptFilename),
- scriptLineNmbr(e.scriptLineNmbr)
- {}
- //==============================================================================
- // what =
- //==============================================================================
- const char* Exception::what() const throw()
- {
- errWhat = "Scanner exception (#" +
- boost::lexical_cast<std::string>(errNo) +
- ":" + scriptFilename + ':' +
- boost::lexical_cast<std::string>(scriptLineNmbr) + "): " + error;
- return errWhat.c_str();
- }
- } // end namespace
|