summaryrefslogtreecommitdiff
path: root/src/error.h
diff options
context:
space:
mode:
authordeva <deva>2005-03-27 10:18:02 +0000
committerdeva <deva>2005-03-27 10:18:02 +0000
commit29ff2e254871ebc359af344d6ee453047e8ad2ec (patch)
treee2c24aa35e16fb612f3715d8a272b3cd4520537f /src/error.h
parent63ac729b32331438a607ec5b8be046143c7592e6 (diff)
Reimplemented the error object as a stack.
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/error.h b/src/error.h
index 09cfbb9..8b26471 100644
--- a/src/error.h
+++ b/src/error.h
@@ -30,6 +30,15 @@
#include <string>
using namespace std;
+/**
+ * This struct contains one error, and a pointer to the previous one.
+ */
+typedef struct __err_entry {
+ string errstr;
+ struct __err_entry *prev;
+} _err_entry;
+
+
class Error {
public:
Error();
@@ -37,17 +46,17 @@ public:
// Status methods
bool hasError();
- string getErrorString();
+ string popErrorString();
// Set methods
- void setError(char* errstr);
- void setError(string &errstr);
- void removeError();
+ void pushError(char* errstr);
+ void pushError(string &errstr);
+ void removeAllErrors();
private:
// Used to save the state of the network and camera connections.
bool error;
- string lastError;
+ _err_entry *lastError;
};
#endif/*__MIAV_ERROR_H__*/