From 29ff2e254871ebc359af344d6ee453047e8ad2ec Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 27 Mar 2005 10:18:02 +0000 Subject: Reimplemented the error object as a stack. --- src/error.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/error.h') 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 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__*/ -- cgit v1.2.3