- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
r10821 r10916 234 234 } 235 235 236 for ( const auto & elem: this->sections_)237 { 238 file << (elem)->getFileEntry() << endl;239 240 for (std::list<ConfigFileEntry*>::const_iterator it_entries = (elem)->getEntriesBegin(); it_entries != (elem)->getEntriesEnd(); ++it_entries)236 for (ConfigFileSection* section : this->sections_) 237 { 238 file << section->getFileEntry() << endl; 239 240 for (std::list<ConfigFileEntry*>::const_iterator it_entries = section->getEntriesBegin(); it_entries != section->getEntriesEnd(); ++it_entries) 241 241 file << (*it_entries)->getFileEntry() << endl; 242 242 … … 278 278 @brief Returns a pointer to the section with given name (or nullptr if the section doesn't exist). 279 279 */ 280 ConfigFileSection* ConfigFile::getSection(const std::string& section ) const281 { 282 for ( const auto & elem: this->sections_)283 if ( (elem)->getName() == section)284 return (elem);280 ConfigFileSection* ConfigFile::getSection(const std::string& sectionName) const 281 { 282 for (ConfigFileSection* section : this->sections_) 283 if (section->getName() == sectionName) 284 return section; 285 285 return nullptr; 286 286 } … … 289 289 @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created. 290 290 */ 291 ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section )292 { 293 for ( auto & elem: this->sections_)294 if ( (elem)->getName() == section)295 return (elem);291 ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& sectionName) 292 { 293 for (ConfigFileSection* section : this->sections_) 294 if (section->getName() == sectionName) 295 return section; 296 296 297 297 this->bUpdated_ = true; 298 298 299 return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section )));299 return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(sectionName))); 300 300 } 301 301 … … 307 307 bool sectionsUpdated = false; 308 308 309 for ( auto & elem: this->sections_)310 { 311 if ( (elem)->bUpdated_)309 for (ConfigFileSection* section : this->sections_) 310 { 311 if (section->bUpdated_) 312 312 { 313 313 sectionsUpdated = true; 314 (elem)->bUpdated_ = false;314 section->bUpdated_ = false; 315 315 } 316 316 }
Note: See TracChangeset
for help on using the changeset viewer.