21#ifndef KI_EXCEPTION_H_
22#define KI_EXCEPTION_H_
35#define THROW_IO_ERROR( msg ) throw IO_ERROR( msg, __FILE__, __FUNCTION__, __LINE__ )
54 const wxString
What()
const
84 IO_ERROR(
const wxString& aProblem,
const char* aThrowersFile,
85 const char* aThrowersFunction,
int aThrowersLineNumber )
87 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber );
93 void init(
const wxString& aProblem,
const char* aThrowersFile,
94 const char* aThrowersFunction,
int aThrowersLineNumber );
96 virtual const wxString Problem()
const;
97 virtual const wxString Where()
const;
99 virtual const char* what()
const throw() override;
100 virtual const wxString What() const;
131 const char* aThrowersFunction,
int aThrowersLineNumber,
132 const wxString& aSource,
const char* aInputLine,
133 int aLineNumber,
int aByteIndex ) :
136 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber,
137 aSource, aInputLine, aLineNumber, aByteIndex );
140 void init(
const wxString& aProblem,
const char* aThrowersFile,
141 const char* aThrowersFunction,
int aThrowersLineNumber,
142 const wxString& aSource,
const char* aInputLine,
143 int aLineNumber,
int aByteIndex );
161#define THROW_PARSE_ERROR( aProblem, aSource, aInputLine, aLineNumber, aByteIndex ) \
162 throw PARSE_ERROR( aProblem, __FILE__, __FUNCTION__, __LINE__, aSource, aInputLine, \
163 aLineNumber, aByteIndex )
177 const wxString& aRequiredGenerator = wxEmptyString );
179 const wxString& aRequiredGenerator = wxEmptyString );
182 void init(
const wxString& aRequiredVersion,
183 const wxString& aRequiredGenerator = wxEmptyString );
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
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.
KI_PARAM_ERROR(const wxString &aMessage)
Constructor.
const wxString What() const
virtual ~KI_PARAM_ERROR()
int lineNumber
at which line number, 1 based index.
const wxString ParseProblem()
std::string inputLine
problem line of input [say, from a LINE_READER].
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
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)