From 55a7afdedc7cee2df9012f600dd51aff92ad1af3 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 5 Apr 2005 11:22:05 +0000 Subject: Added validity checking on the conf parser. Added error object to conf parser. Cleaned up the configure.in script --- src/miav_config.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/miav_config.h') diff --git a/src/miav_config.h b/src/miav_config.h index 1ca6e04..45eab0c 100644 --- a/src/miav_config.h +++ b/src/miav_config.h @@ -30,6 +30,8 @@ #include using namespace std; +#include "error.h" + typedef struct __cfg { string *name; bool boolval; @@ -41,7 +43,7 @@ typedef struct __cfg { class MiavConfig { public: - MiavConfig(char *file); + MiavConfig(char *file, Error* err = NULL); ~MiavConfig(); int readInt(char *node); @@ -50,9 +52,13 @@ public: float readFloat(char *node); private: + string emptyString; + Error* error; + string filename; _cfg *addConfig(_cfg *parent, char* conf); int parse(char* conf); char *strip(char* conf); + _cfg *parseError(char* msg, char* line); _cfg *findNode(char* node); _cfg *configs; }; -- cgit v1.2.3