libcsdbg  1.28
C++ exception (and generic) stack trace debug library
exception.hpp
Go to the documentation of this file.
1 #ifndef _CSDBG_EXCEPTION
2 #define _CSDBG_EXCEPTION 1
3 
10 #include "./object.hpp"
11 
12 namespace csdbg {
13 
14 std::ostream& operator<<(std::ostream&, const std::exception&);
15 
26 class exception: virtual public object
27 {
28 protected:
29 
30  /* Protected variables */
31 
32  i8 *m_msg;
34 public:
35 
36  /* Friend classes and functions */
37 
38  friend std::ostream& operator<<(std::ostream&, const exception&);
39 
40 
41  /* Constructors, copy constructors and destructor */
42 
43  explicit exception(const i8*, ...);
44 
45  exception(const exception&);
46 
47  virtual ~exception();
48 
49  virtual exception* clone() const;
50 
51 
52  /* Accessor methods */
53 
54  virtual const i8* msg() const;
55 
56 
57  /* Operator overloading methods */
58 
59  virtual exception& operator=(const exception&);
60 };
61 
62 }
63 
64 #endif
65 
exception(const i8 *,...)
Object constructor.
Definition: exception.cpp:64
This abstract class serves as the root of the class hierarchy tree.
Definition: object.hpp:17
char i8
8-bit signed integer
Definition: config.hpp:72
std::ostream & operator<<(std::ostream &, const std::exception &)
Stream insertion operator for std::exception objects.
Definition: exception.cpp:23
Class csdbg::object definition.
virtual exception * clone() const
Object virtual copy constructor.
Definition: exception.cpp:112
friend std::ostream & operator<<(std::ostream &, const exception &)
Stream insertion operator for csdbg::exception objects.
Definition: exception.cpp:42
virtual const i8 * msg() const
Get the exception message.
Definition: exception.cpp:123
virtual ~exception()
Object destructor.
Definition: exception.cpp:98
i8 * m_msg
Error description message.
Definition: exception.hpp:32
virtual exception & operator=(const exception &)
Assignment operator.
Definition: exception.cpp:136
This class is a throwable with a textual description of an error.
Definition: exception.hpp:26