00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "MyGUI_Precompiled.h"
00024 #include "MyGUI_Exception.h"
00025 #include "MyGUI_Utility.h"
00026
00027 namespace MyGUI
00028 {
00029
00030 Exception::Exception(const std::string& _description, const std::string& _source, const char* _file, long _line ) :
00031 mDescription(_description),
00032 mSource(_source),
00033 mFile(_file),
00034 mLine(_line)
00035 {
00036 }
00037
00038 Exception::Exception(const Exception& _rhs) :
00039 mDescription(_rhs.mDescription),
00040 mSource(_rhs.mSource),
00041 mFile(_rhs.mFile),
00042 mLine(_rhs.mLine)
00043 {
00044 }
00045
00046 void Exception::operator = (const Exception& _rhs)
00047 {
00048 mDescription = _rhs.mDescription;
00049 mSource = _rhs.mSource;
00050 mFile = _rhs.mFile;
00051 mLine = _rhs.mLine;
00052 }
00053
00054
00055 const std::string& Exception::getFullDescription() const
00056 {
00057 if (mFullDesc.empty())
00058 {
00059 if ( mLine > 0 )
00060 {
00061 mFullDesc = utility::toString("MyGUI EXCEPTION : ", mDescription, " in ", mSource, " at ", mFile, " (line ", mLine, ")");
00062 }
00063 else
00064 {
00065 mFullDesc = utility::toString("MyGUI EXCEPTION : ", mDescription, " in ", mSource);
00066 }
00067 }
00068
00069 return mFullDesc;
00070 }
00071
00072 }