GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Throwables.hpp
Go to the documentation of this file.
1 #ifndef RADIX_THROWABLES_HPP
2 #define RADIX_THROWABLES_HPP
3 
4 #include <stdexcept>
5 #include <string>
6 
7 namespace radix {
8 namespace Exception {
9 
10 class Error : public std::exception {
11 protected:
12  const std::string src, msg;
13 
14 public:
15  Error(const std::string &s, const std::string &m) : src(s), msg(m) {}
16  Error(const std::string &s, const char *m) : src(s), msg(m){}
17  Error(const char *s, const std::string &m) : src(s), msg(m) {}
18  Error(const char *s, const char *m) : src(s), msg(m) {}
19 
20  const char* source() const noexcept {
21  return src.c_str();
22  }
23  const char* what() const noexcept {
24  return msg.c_str();
25  }
26 };
27 
28 
29 } /* namespace Exception */
30 } /* namespace radix */
31 
32 #endif /* RADIX_THROWABLES_HPP */
Definition: GameController.hpp:7
Error(const std::string &s, const std::string &m)
Definition: Throwables.hpp:15
Error(const char *s, const char *m)
Definition: Throwables.hpp:18
const char * source() const noexcept
Definition: Throwables.hpp:20
Error(const std::string &s, const char *m)
Definition: Throwables.hpp:16
Definition: Throwables.hpp:10
const char * what() const noexcept
Definition: Throwables.hpp:23
const std::string msg
Definition: Throwables.hpp:12
Error(const char *s, const std::string &m)
Definition: Throwables.hpp:17
const std::string src
Definition: Throwables.hpp:12