- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
r10817 r10821 234 234 } 235 235 236 for ( std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)237 { 238 file << ( *it)->getFileEntry() << endl;239 240 for (std::list<ConfigFileEntry*>::const_iterator it_entries = ( *it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)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) 241 241 file << (*it_entries)->getFileEntry() << endl; 242 242 … … 280 280 ConfigFileSection* ConfigFile::getSection(const std::string& section) const 281 281 { 282 for ( std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)283 if (( *it)->getName() == section)284 return ( *it);282 for (const auto & elem : this->sections_) 283 if ((elem)->getName() == section) 284 return (elem); 285 285 return nullptr; 286 286 } … … 291 291 ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section) 292 292 { 293 for ( std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)294 if (( *it)->getName() == section)295 return ( *it);293 for (auto & elem : this->sections_) 294 if ((elem)->getName() == section) 295 return (elem); 296 296 297 297 this->bUpdated_ = true; … … 307 307 bool sectionsUpdated = false; 308 308 309 for ( std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)310 { 311 if (( *it)->bUpdated_)309 for (auto & elem : this->sections_) 310 { 311 if ((elem)->bUpdated_) 312 312 { 313 313 sectionsUpdated = true; 314 ( *it)->bUpdated_ = false;314 (elem)->bUpdated_ = false; 315 315 } 316 316 }
Note: See TracChangeset
for help on using the changeset viewer.