5#if !defined(CXEXCEPTION_INCLUDE_H)
6#define CXEXCEPTION_INCLUDE_H
14BEGIN_MOOTOOLS_NAMESPACE
21 DLL_TOOLSFUNCTION
void XDeleteThreadException();
37 virtual bool ReportError(
unsigned int nMessageID = 0);
43 class DLL_TOOLSFUNCTION CXFileException :
public CXException
45 DECLARE_DYNAMIC_XOBJECT(CXFileException)
48 typedef enum FileExceptionType {
70 FileExceptionType cause;
73 static FileExceptionType ErrnoToException(
int nErrno);
79 virtual CXString GetErrorMessage()
const;
83 virtual void Dump()
const;
88 class DLL_TOOLSFUNCTION CXArchiveException :
public CXException
90 DECLARE_DYNAMIC_XOBJECT(CXArchiveException)
93 typedef enum ArchiveExceptionType {
103 } ArchiveExceptionType;
114 virtual CXString GetErrorMessage()
const;
117 virtual void Dump()
const;
126 class DLL_TOOLSFUNCTION CXMemoryException :
public CXException
128 DECLARE_DYNAMIC_XOBJECT(CXMemoryException)
131 class DLL_TOOLSFUNCTION CXInvalidArgException :
public CXException
133 DECLARE_DYNAMIC_XOBJECT(CXInvalidArgException)
137 class DLL_TOOLSFUNCTION CXInternetException :
public CXException
139 DECLARE_DYNAMIC_XOBJECT(CXInternetException)
142 typedef enum InternetExceptionType {
145 } InternetExceptionType;
148 CXInternetException(
longuint context,
unsigned int error = 0);
159 virtual void Dump()
const;
163#define XThrowException(exception) \
165 XTRACE(_T("Warning: throwing exception of type %s\n"), _T(#exception)); \
166 exception *ex = xNew(exception); \
167 XSetThreadException(ex); \
171#define XThrowExceptionWithArgs(exception, ...) \
173 XTRACE(_T("Warning: throwing exception of type %s\n"), _T(#exception)); \
174 exception *ex = xNewParams(exception, __VA_ARGS__); \
175 XSetThreadException(ex); \
179#define XENSURE(cond) \
182 XThrowException(CXInvalidArgException) \
185#define XTHROW_LAST() throw
192#define XCATCH(class, e) \
196 XASSERT(e->IsKindOf(XRUNTIME_CLASS(CXException)));
205 XDeleteThreadException(); \
208END_MOOTOOLS_NAMESPACE
CXTString< TCHAR > CXString
CXString depend on the target OS. Could be CXStringW (Windows) or CXStringA (Linux / Macos)
Definition XString.h:118
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
Definition XException.h:27
Definition XException.h:122