MyGUI 3.4.3
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#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
15 // disable: warning C4275: non dll-interface class '***' used as base for dll-interface clas '***'
16 #pragma warning(push)
17 #pragma warning(disable : 4275)
18#endif
19
20namespace MyGUI
21{
22
23 class MYGUI_EXPORT Exception : public std::exception
24 {
25 public:
26 Exception(std::string _description, std::string _source, std::string _file, long _line);
27
28 virtual const std::string& getFullDescription() const;
29
30 virtual const std::string& getSource() const;
31
32 virtual const std::string& getFile() const;
33
34 virtual long getLine() const;
35
36 virtual const std::string& getDescription() const;
37
38 const char* what() const noexcept override;
39
40 protected:
41 std::string mDescription;
42 std::string mSource;
43 std::string mFile;
44 long mLine;
45 mutable std::string mFullDesc;
46 };
47
48} // namespace MyGUI
49
50#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
51 #pragma warning(pop)
52#endif
53
54#endif // MYGUI_EXCEPTION_H_
#define MYGUI_EXPORT
Exception(std::string _description, std::string _source, std::string _file, long _line)
std::string mFullDesc
virtual long getLine() const
std::string mSource
virtual const std::string & getSource() const
const char * what() const noexcept override
std::string mDescription
virtual const std::string & getFullDescription() const
virtual const std::string & getFile() const
virtual const std::string & getDescription() const