summaryrefslogtreecommitdiff
path: root/include/Exceptions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/Exceptions.h')
-rw-r--r--include/Exceptions.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/include/Exceptions.h b/include/Exceptions.h
index 87ba6d1..f04970c 100644
--- a/include/Exceptions.h
+++ b/include/Exceptions.h
@@ -37,6 +37,7 @@ class MemoryException;
char * xstrdup(const char *) throw (MemoryException);
void * xmalloc(ssize_t) throw (MemoryException);
void xfree(void *&);
+void * xrealloc(void *, size_t) throw (MemoryException);
// On prédéfinit la classe String, pour éviter
// les deadlocks de compilation...
@@ -48,7 +49,10 @@ class Base {
return xstrdup(s);
}
void * malloc(ssize_t s) const {
- return malloc(s);
+ return xmalloc(s);
+ }
+ void * realloc(void * p, size_t s) {
+ return xrealloc(p, s);
}
void * operator new(size_t s) {
return xmalloc(s);
@@ -56,6 +60,9 @@ class Base {
void * operator new(size_t s, void * p) {
return memset(p, 0, s);
}
+ void operator delete(void * p) {
+ xfree(p);
+ }
void free(void * p) const {
xfree(p);
}
@@ -86,19 +93,21 @@ enum op_t {
IO_READ
};
-class IOException : public GeneralException {
+class IOGeneral : public GeneralException {
public:
- IOException(String, op_t, ssize_t);
+ IOGeneral(String);
+ protected:
+ IOGeneral();
};
-class IOGeneral : public GeneralException {
+class IOException : public IOGeneral {
public:
- IOGeneral(String);
+ IOException(String, op_t, ssize_t);
};
-class IOInternal : public GeneralException {
+class IOAgain : public IOGeneral {
public:
- IOInternal(String, op_t);
+ IOAgain();
};
#else