00001 #ifndef __CSIMERROR_H__ 00002 #define __CSIMERROR_H__ 00003 00004 #include <stdlib.h> 00005 #include <stdio.h> 00006 #include <stdarg.h> 00007 #include <string.h> 00008 00010 class csimError { 00011 public: 00012 csimError(void) { 00013 lMessage=128; 00014 message=(char *)malloc(lMessage*sizeof(char)); 00015 message[0]=0; 00016 add("\nCSIM-ERROR: "); 00017 } 00018 ~csimError() { if (message) free(message); message=0; } 00019 00021 void add(const char *fmt, ...); 00022 00024 void clear(void) { message[0]=0; } 00025 00027 char *msg(void) { return message; } 00028 00030 bool hasErrorMsg(void) { return (message[0]!=0); } 00031 private: 00032 char *message; 00033 int lMessage; 00034 }; 00035 00036 extern csimError TheCsimError; 00037 00038 #endif