MyGUI  3.2.1
MyGUI_Exception.h
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef __MYGUI_EXCEPTION_H__
8 #define __MYGUI_EXCEPTION_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include <exception>
12 #include <string>
13 
14 namespace MyGUI
15 {
16 
18  public std::exception
19  {
20  public:
21  Exception(const std::string& _description, const std::string& _source, const char* _file, long _line);
22 
23  Exception(const Exception& _rhs);
24 
25  // Needed for compatibility with std::exception
26  ~Exception() throw();
27 
28  Exception& operator = (const Exception& _rhs);
29 
30  virtual const std::string& getFullDescription() const;
31 
32  virtual const std::string& getSource() const;
33 
34  virtual const std::string& getFile() const;
35 
36  virtual long getLine() const;
37 
38  virtual const std::string& getDescription() const;
39 
40  // Override std::exception::what
41  const char* what() const throw();
42 
43  protected:
44  std::string mDescription;
45  std::string mSource;
46  std::string mFile;
47  long mLine;
48  mutable std::string mFullDesc;
49  };
50 
51 } // namespace MyGUI
52 
53 #endif // __MYGUI_EXCEPTION_H__