Changeset 1634 for code/branches/gcc43/src/core/ConfigFileManager.h
- Timestamp:
- Jun 29, 2008, 7:36:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gcc43/src/core/ConfigFileManager.h
r1505 r1634 82 82 { 83 83 public: 84 inlineConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : name_(name), value_(value), bString_(bString), additionalComment_(additionalComment) {}85 inlinevirtual ~ConfigFileEntryValue() {}86 87 inlinevirtual const std::string& getName() const84 ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : name_(name), value_(value), bString_(bString), additionalComment_(additionalComment) {} 85 virtual ~ConfigFileEntryValue() {} 86 87 virtual const std::string& getName() const 88 88 { return this->name_; } 89 89 90 inlinevirtual void setComment(const std::string& comment)90 virtual void setComment(const std::string& comment) 91 91 { this->additionalComment_ = comment; } 92 92 … … 94 94 virtual std::string getValue() const; 95 95 96 inlinebool isString() const96 bool isString() const 97 97 { return this->bString_; } 98 inlinevoid setString(bool bString)98 void setString(bool bString) 99 99 { this->bString_ = bString; } 100 100 … … 115 115 { 116 116 public: 117 inlineConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : ConfigFileEntryValue(name, value, bString, additionalComment), index_(index) {}118 inlinevirtual ~ConfigFileEntryVectorValue() {}119 120 inlinevirtual unsigned int getIndex() const117 ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : ConfigFileEntryValue(name, value, bString, additionalComment), index_(index) {} 118 virtual ~ConfigFileEntryVectorValue() {} 119 120 virtual unsigned int getIndex() const 121 121 { return this->index_; } 122 122 … … 134 134 { 135 135 public: 136 inlineConfigFileEntryComment(const std::string& comment) : comment_(comment) {}137 inlinevirtual ~ConfigFileEntryComment() {}138 139 inlinevirtual const std::string& getName() const136 ConfigFileEntryComment(const std::string& comment) : comment_(comment) {} 137 virtual ~ConfigFileEntryComment() {} 138 139 virtual const std::string& getName() const 140 140 { return this->comment_; } 141 141 142 inlinevirtual void setComment(const std::string& comment)142 virtual void setComment(const std::string& comment) 143 143 { this->comment_ = comment; } 144 144 145 inlinevirtual void setValue(const std::string& value)145 virtual void setValue(const std::string& value) 146 146 {} 147 inlinevirtual std::string getValue() const147 virtual std::string getValue() const 148 148 { return this->comment_; } 149 149 150 inlinevoid setString(bool bString) {}151 152 inlinevirtual std::string getFileEntry() const150 void setString(bool bString) {} 151 152 virtual std::string getFileEntry() const 153 153 { return this->comment_; } 154 154 … … 166 166 167 167 public: 168 inlineConfigFileSection(const std::string& name, const std::string& additionalComment = "") : name_(name), additionalComment_(additionalComment), bUpdated_(false) {}168 ConfigFileSection(const std::string& name, const std::string& additionalComment = "") : name_(name), additionalComment_(additionalComment), bUpdated_(false) {} 169 169 ~ConfigFileSection(); 170 170 171 inlineconst std::string& getName() const171 const std::string& getName() const 172 172 { return this->name_; } 173 173 174 inlinevoid setComment(const std::string& comment)174 void setComment(const std::string& comment) 175 175 { this->additionalComment_ = comment; } 176 176 177 inlinevoid setValue(const std::string& name, const std::string& value, bool bString)177 void setValue(const std::string& name, const std::string& value, bool bString) 178 178 { this->getEntry(name, value, bString)->setValue(value); } 179 inlinestd::string getValue(const std::string& name, const std::string& fallback, bool bString)179 std::string getValue(const std::string& name, const std::string& fallback, bool bString) 180 180 { return this->getEntry(name, fallback, bString)->getValue(); } 181 181 182 inlinevoid setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)182 void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString) 183 183 { this->getEntry(name, index, value, bString)->setValue(value); } 184 inlinestd::string getValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)184 std::string getValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString) 185 185 { return this->getEntry(name, index, fallback, bString)->getValue(); } 186 186 … … 201 201 std::list<ConfigFileEntry*>::iterator getEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString); 202 202 203 inlineConfigFileEntry* getEntry(const std::string& name, const std::string& fallback, bool bString)203 ConfigFileEntry* getEntry(const std::string& name, const std::string& fallback, bool bString) 204 204 { return (*this->getEntryIterator(name, fallback, bString)); } 205 inlineConfigFileEntry* getEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)205 ConfigFileEntry* getEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString) 206 206 { return (*this->getEntryIterator(name, index, fallback, bString)); } 207 207 … … 219 219 { 220 220 public: 221 inlineConfigFile(const std::string& filename) : filename_(filename), bUpdated_(false) {}221 ConfigFile(const std::string& filename) : filename_(filename), bUpdated_(false) {} 222 222 ~ConfigFile(); 223 223 … … 227 227 void clean(bool bCleanComments = false); 228 228 229 inlinevoid setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)229 void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString) 230 230 { this->getSection(section)->setValue(name, value, bString); this->save(); } 231 inlinestd::string getValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)231 std::string getValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString) 232 232 { std::string output = this->getSection(section)->getValue(name, fallback, bString); this->saveIfUpdated(); return output; } 233 233 234 inlinevoid setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)234 void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString) 235 235 { this->getSection(section)->setValue(name, index, value, bString); this->save(); } 236 inlinestd::string getValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)236 std::string getValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString) 237 237 { std::string output = this->getSection(section)->getValue(name, index, fallback, bString); this->saveIfUpdated(); return output; } 238 238 239 inlinevoid deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0)239 void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0) 240 240 { this->getSection(section)->deleteVectorEntries(name, startindex); } 241 inlineunsigned int getVectorSize(const std::string& section, const std::string& name)241 unsigned int getVectorSize(const std::string& section, const std::string& name) 242 242 { return this->getSection(section)->getVectorSize(name); } 243 243 … … 271 271 void clean(ConfigFileType type, bool bCleanComments = false); 272 272 273 inlinevoid setValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& value, bool bString)273 void setValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& value, bool bString) 274 274 { this->getFile(type)->setValue(section, name, value, bString); } 275 inlinestd::string getValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& fallback, bool bString)275 std::string getValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& fallback, bool bString) 276 276 { return this->getFile(type)->getValue(section, name, fallback, bString); } 277 277 278 inlinevoid setValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)278 void setValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString) 279 279 { this->getFile(type)->setValue(section, name, index, value, bString); } 280 inlinestd::string getValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)280 std::string getValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString) 281 281 { return this->getFile(type)->getValue(section, name, index, fallback, bString); } 282 282 283 inlinevoid deleteVectorEntries(ConfigFileType type, const std::string& section, const std::string& name, unsigned int startindex = 0)283 void deleteVectorEntries(ConfigFileType type, const std::string& section, const std::string& name, unsigned int startindex = 0) 284 284 { this->getFile(type)->deleteVectorEntries(section, name, startindex); } 285 inlineunsigned int getVectorSize(ConfigFileType type, const std::string& section, const std::string& name)285 unsigned int getVectorSize(ConfigFileType type, const std::string& section, const std::string& name) 286 286 { return this->getFile(type)->getVectorSize(section, name); } 287 287
Note: See TracChangeset
for help on using the changeset viewer.