17 void detail::throwBadCast(std::string_view _from, std::string_view _to,
const char* _file,
int _line)
19 std::ostringstream stream;
20 stream <<
"Cannot cast from type '" << _from <<
"' to type '" << _to <<
"'.";
21 std::string message = stream.str();
22 LogManager::getInstance().log(
MYGUI_LOG_SECTION, LogLevel::Critical, message, _file, _line);
24 throw Exception(std::move(message),
"MyGUI", _file, _line);
27 Exception::Exception(std::string _description, std::string _source, std::string _file,
long _line) :
28 mDescription(std::move(_description)),
29 mSource(std::move(_source)),
30 mFile(std::move(_file)),
35 const std::string& Exception::getFullDescription()
const
37 if (mFullDesc.empty())
41 mFullDesc = utility::toString(
54 mFullDesc = utility::toString(
"MyGUI EXCEPTION : ", mDescription,
" in ", mSource);
61 const std::string& Exception::getSource()
const
66 const std::string& Exception::getFile()
const
71 long Exception::getLine()
const
76 const std::string& Exception::getDescription()
const
82 const char* Exception::what() const noexcept
84 return getFullDescription().c_str();
#define MYGUI_LOG_SECTION