1 // $Id: gc_errhandling.cpp,v 1.13 2011/03/08 19:21:59 bobgian Exp $
2 
3 /*
4   Copyright 2002  Mary Kuhner, Jon Yamato, and Joseph Felsenstein
5 
6   This software is distributed free of charge for non-commercial use
7   and is copyrighted.  Of course, we do not guarantee that the software
8   works, and are not responsible for any damage you may cause or have.
9 */
10 
11 #include <cassert>
12 
13 #include "gc_errhandling.h"
14 #include "gc_strings.h"
15 
16 //------------------------------------------------------------------------------------
17 
gc_ex(wxString string)18 gc_ex::gc_ex(wxString string) throw()
19     :   m_what(string),
20         m_row(0),
21         m_fileName(wxEmptyString)
22 {
23 }
24 
~gc_ex()25 gc_ex::~gc_ex() throw()
26 {
27 }
28 
29 bool
hasRow() const30 gc_ex::hasRow() const throw()
31 {
32     return m_row > 0;
33 }
34 
35 size_t
getRow() const36 gc_ex::getRow() const throw()
37 {
38     return m_row;
39 }
40 
41 void
setRow(size_t row)42 gc_ex::setRow(size_t row) throw ()
43 {
44     m_row = row;
45 }
46 
47 void
setRow(int row)48 gc_ex::setRow(int row) throw ()
49 {
50     assert(row >= 0);
51     m_row = (size_t)row;
52 }
53 
54 bool
hasFile() const55 gc_ex::hasFile() const throw()
56 {
57     return !m_fileName.IsEmpty();
58 }
59 
60 wxString
getFile() const61 gc_ex::getFile() const throw()
62 {
63     return m_fileName;
64 }
65 
66 void
setFile(const wxString & fileName)67 gc_ex::setFile(const wxString& fileName) throw ()
68 {
69     m_fileName = fileName;
70 }
71 
72 const char *
what() const73 gc_ex::what() const throw()
74 {
75     return m_what.c_str();
76 }
77 
78 const wxString &
wxWhat() const79 gc_ex::wxWhat() const throw()
80 {
81     return m_what;
82 }
83 
84 //------------------------------------------------------------------------------------
85 
gc_data_error(const wxString & wh)86 gc_data_error::gc_data_error(const wxString & wh)
87     :
88     gc_ex(wh)
89 {
90 }
91 
~gc_data_error()92 gc_data_error::~gc_data_error() throw()
93 {
94 }
95 
96 //------------------------------------------------------------------------------------
97 
gc_implementation_error(const wxString & wh)98 gc_implementation_error::gc_implementation_error(const wxString & wh)
99     :
100     gc_ex(wh)
101 {
102 }
103 
~gc_implementation_error()104 gc_implementation_error::~gc_implementation_error() throw()
105 {
106 }
107 
108 //------------------------------------------------------------------------------------
109 
gui_error(const wxString & wh)110 gui_error::gui_error(const wxString & wh)
111     :
112     gc_ex(wh)
113 {
114 }
115 
~gui_error()116 gui_error::~gui_error() throw()
117 {
118 }
119 
120 //------------------------------------------------------------------------------------
121 
gc_abandon_export()122 gc_abandon_export::gc_abandon_export() throw()
123     :
124     gc_ex(gcerr::abandonExport)
125 {
126 }
127 
~gc_abandon_export()128 gc_abandon_export::~gc_abandon_export() throw()
129 {
130 }
131 
132 //------------------------------------------------------------------------------------
133 
gc_fatal_error()134 gc_fatal_error::gc_fatal_error()
135     :
136     gc_ex(wxEmptyString)
137 {
138 }
139 
~gc_fatal_error()140 gc_fatal_error::~gc_fatal_error() throw()
141 {
142 }
143 
144 //____________________________________________________________________________________
145