#ifndef _CONFIG_H_ #define _CONFIG_H_ #include "list.h" class Config { public: ~Config(); bool parseFile(const char* name); void show() const; const char* getParameter(const char* section, const char* name) const; const char* getString(const char* section, const char* name, char* def) const; int getInteger(const char* section, const char* name, int def) const; Iterator* createIterator(const char* section, const char* name); private: class Tupel { public: Tupel(const char* name, const char* value); ~Tupel(); const char* name; const char* value; }; class Section { public: class SectionIterator : public Iterator { public: SectionIterator(Section* section, const char* name); ~SectionIterator(); bool hasNext(); char* next(); void reset(); private: Iterator* it; Tupel* nexttup; const char* name; }; Section(const char* name); ~Section(); bool addTupel(const char* name, const char* option); const char* getTupelValue(const char* name) const; void show() const; const char* name; private: List tupelList; }; Section* addSection(const char* name); Section* getSection(const char* name) const; List
sectionList; }; #endif // _CONFIG_H_