00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00023 #ifndef __LRT_INI__
00024 #define __LRT_INI__
00025
00026 #include "rtmap.h"
00027
00028 namespace lrt {
00029
00035 class IniSection : public StringMap<String> {
00036 public:
00038 IniSection() : StringMap<String>(false) {}
00039
00041 IniSection(const IniSection& is) : StringMap<String>(is) {}
00042
00043 virtual ~IniSection() {}
00044 };
00045
00056 class IniFile {
00057 public:
00058 typedef StringMap<IniSection>::Iterator Iterator;
00059
00061 IniFile();
00065 IniFile(const String& filename);
00066
00068 bool hasSection(const String& name) const;
00069
00075 IniSection& getSection(const String& name);
00076
00080 const IniSection& getSectionConst(const String& name) const;
00081
00087 void addSection(const String& name, const IniSection& section);
00088
00092 bool removeSection(const String& name);
00093
00097 Iterator begin();
00098
00100 Iterator begin() const;
00101
00105 bool read(const String& filename);
00106
00111 bool write(const String& filename);
00112
00113 private:
00114 StringMap<IniSection> data;
00115 };
00116
00117 }
00118
00119 #endif
00120