42 #ifndef __XBEXCEPT_H__ 43 #define __XBEXCEPT_H__ 62 #ifndef HAVE_EXCEPTIONS 63 #define xb_error(code) { return code;} 64 #define xb_io_error(code,name) { return code;} 65 #define xb_open_error(name) { return XB_OPEN_ERROR;} 66 #define xb_memory_error { return XB_NO_MEMORY;} 67 #define xb_eof_error { return XB_EOF;} 73 #elif HAVE_G___EXCEPTION_H 74 #include <g++/exception.h> 76 #error "Exceptions are unsupported on your system." 80 #define XB_THROW throw () 93 xbException (
int err);
94 virtual ~xbException () XB_THROW;
95 virtual const char* what()
const XB_THROW;
96 virtual const char *error();
102 #define xb_error(code) {throw xbException(code);return (code);} 108 class XBDLLEXPORT xbIOException :
public xbException {
110 xbIOException (
int err);
111 xbIOException (
int err,
const char *n);
112 virtual ~xbIOException () XB_THROW;
113 virtual const char* what()
const XB_THROW;
114 const char *_errno()
const;
120 #define xb_io_error(code, name) {throw xbIOException(code,name);return (code);} 126 class XBDLLEXPORT xbOpenException :
public xbIOException {
129 xbOpenException (
const char *n);
130 virtual ~xbOpenException () XB_THROW;
131 virtual const char* what()
const XB_THROW;
134 #define xb_open_error(name) { throw xbOpenException(name); return 0;} 140 class XBDLLEXPORT xbOutOfMemoryException :
public xbException {
142 xbOutOfMemoryException ();
143 virtual ~xbOutOfMemoryException () XB_THROW;
144 virtual const char* what()
const XB_THROW;
147 #define xb_memory_error {throw xbOutOfMemoryException();return 0;} 153 class XBDLLEXPORT xbEoFException :
public xbIOException {
156 virtual ~xbEoFException () XB_THROW;
157 virtual const char* what()
const XB_THROW;
160 #define xb_eof_error {throw xbEoFException();return 0;} 164 #endif // __XBEXCEPT_H__
#define XBDLLEXPORT
Definition: xbase.h:101
const char * xbStrError(xbShort err)
Short description.
Definition: xbexcept.cpp:66
short int xbShort
xbShort type
Definition: xtypes.h:65