Changeset 1030 for code/branches/core2/src/orxonox/core/ConfigFileManager.h
- Timestamp:
- Apr 12, 2008, 3:34:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/ConfigFileManager.h
r1027 r1030 107 107 108 108 /////////////////////////////// 109 // ConfigFileEntry ArrayValue //109 // ConfigFileEntryVectorValue // 110 110 /////////////////////////////// 111 class _CoreExport ConfigFileEntry ArrayValue : public ConfigFileEntryValue112 { 113 public: 114 inline ConfigFileEntry ArrayValue(const std::string& name, unsigned int index, const std::string& value = "", const std::string& additionalComment = "") : ConfigFileEntryValue(name, value, additionalComment), index_(index) {}115 inline virtual ~ConfigFileEntry ArrayValue() {}111 class _CoreExport ConfigFileEntryVectorValue : public ConfigFileEntryValue 112 { 113 public: 114 inline ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", const std::string& additionalComment = "") : ConfigFileEntryValue(name, value, additionalComment), index_(index) {} 115 inline virtual ~ConfigFileEntryVectorValue() {} 116 116 117 117 inline virtual unsigned int getIndex() const … … 179 179 inline const std::string& getValue(const std::string& name, unsigned int index, const std::string& fallback) 180 180 { return this->getEntry(name, index, fallback)->getValue(); } 181 182 void deleteVectorEntries(const std::string& name, unsigned int startindex = 0); 183 unsigned int getVectorSize(const std::string& name); 181 184 182 185 std::string getFileEntry() const; … … 216 219 void load(bool bCreateIfNotExisting = true); 217 220 void save() const; 218 void clean( );221 void clean(bool bCleanComments = false); 219 222 220 223 inline void setValue(const std::string& section, const std::string& name, const std::string& value) … … 228 231 { const std::string& output = this->getSection(section)->getValue(name, index, fallback); this->saveIfUpdated(); return output; } 229 232 233 inline void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0) 234 { this->getSection(section)->deleteVectorEntries(name, startindex); } 235 inline unsigned int getVectorSize(const std::string& section, const std::string& name) 236 { return this->getSection(section)->getVectorSize(name); } 237 230 238 private: 231 239 ConfigFileSection* getSection(const std::string& section); … … 250 258 void load(bool bCreateIfNotExisting = true); 251 259 void save(); 252 void clean( );260 void clean(bool bCleanComments = false); 253 261 254 262 void load(ConfigFileType type, bool bCreateIfNotExisting = true); 255 263 void save(ConfigFileType type); 256 void clean(ConfigFileType type );264 void clean(ConfigFileType type, bool bCleanComments = false); 257 265 258 266 inline void setValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& value) … … 266 274 { return this->getFile(type)->getValue(section, name, index, fallback); } 267 275 276 inline void deleteVectorEntries(ConfigFileType type, const std::string& section, const std::string& name, unsigned int startindex = 0) 277 { this->getFile(type)->deleteVectorEntries(section, name, startindex); } 278 inline unsigned int getVectorSize(ConfigFileType type, const std::string& section, const std::string& name) 279 { return this->getFile(type)->getVectorSize(section, name); } 280 268 281 void updateConfigValues() const; 269 282 void updateConfigValues(ConfigFileType type) const;
Note: See TracChangeset
for help on using the changeset viewer.