cwidget  0.5.17
exception.h
1 // exception.h -*-c++-*-
2 //
3 // Copyright (C) 2005, 2007 Daniel Burrows
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of
8 // the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; see the file COPYING. If not, write to
17 // the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 // Boston, MA 02111-1307, USA.
19 //
20 // A generic exception class supporting std::string error messages
21 // (unlike std::exception, which only supports const char* error
22 // messages). If execinfo is available and ENABLE_DYNAMIC_BACKTRACE
23 // is defined, it also generates information about the state of the
24 // stack at the time of its instantiation (if not, then
25 // get_backtrace() returns an empty string).
26 
27 #ifndef EXCEPTION_H
28 #define EXCEPTION_H
29 
30 #include <string>
31 #include <vector>
32 
33 namespace cwidget
34 {
35  namespace util
36  {
37  class Exception
38  {
42  std::string bt;
43  public:
44  Exception();
45 
46  std::string get_backtrace() const { return bt; }
47  virtual std::string errmsg() const = 0;
48  virtual ~Exception() {}
49  };
50  }
51 }
52 
53 #endif
The namespace containing everything defined by cwidget.
Definition: columnify.cc:26
Definition: exception.h:37