25 #ifndef KI_EXCEPTION_H_ 26 #define KI_EXCEPTION_H_ 28 #include <wx/string.h> 37 #define THROW_IO_ERROR( msg ) throw IO_ERROR( msg, __FILE__, __FUNCTION__, __LINE__ ) 57 const wxString
What()
const 87 IO_ERROR(
const wxString& aProblem,
const char* aThrowersFile,
88 const char* aThrowersFunction,
int aThrowersLineNumber )
90 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber );
95 void init(
const wxString& aProblem,
const char* aThrowersFile,
96 const char* aThrowersFunction,
int aThrowersLineNumber );
98 virtual const wxString
Problem()
const;
99 virtual const wxString
Where()
const;
101 virtual const wxString
What()
const;
134 const char* aThrowersFunction,
int aThrowersLineNumber,
135 const wxString& aSource,
const char* aInputLine,
136 int aLineNumber,
int aByteIndex ) :
139 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber,
140 aSource, aInputLine, aLineNumber, aByteIndex );
143 void init(
const wxString& aProblem,
const char* aThrowersFile,
144 const char* aThrowersFunction,
int aThrowersLineNumber,
145 const wxString& aSource,
const char* aInputLine,
146 int aLineNumber,
int aByteIndex );
164 #define THROW_PARSE_ERROR( aProblem, aSource, aInputLine, aLineNumber, aByteIndex ) \ 165 throw PARSE_ERROR( aProblem, __FILE__, __FUNCTION__, __LINE__, aSource, aInputLine, \ 166 aLineNumber, aByteIndex ) 182 void init(
const wxString& aRequiredVersion );
187 #endif // KI_EXCEPTION_H_ IO_ERROR(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
Use macro THROW_IO_ERROR() to wrap a call to this constructor at the call site.
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
virtual const wxString Problem() const
what was the problem?
virtual const wxString Where() const
where did the Problem() occur?
virtual ~KI_PARAM_ERROR()
const wxString ParseProblem()
KI_PARAM_ERROR(const wxString &aMessage)
Constructor.
virtual const wxString What() const
A composite of Problem() and Where()
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)
int lineNumber
at which line number, 1 based index.
const wxString What() const
A filename or source description, a problem input line, a line number, a byte offset,...
PARSE_ERROR(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)
Normally called via the macro THROW_PARSE_ERROR so that FILE, FUNCTION, and LINE can be captured from...
int byteIndex
at which byte offset within the line, 1 based index
std::string inputLine
problem line of input [say, from a LINE_READER].
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Hold a translatable error message and may be used when throwing exceptions containing a translated er...