Changeset 8858 for code/trunk/src/libraries/core/ConfigFileManager.cc
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/libraries/core/ConfigFileManager.cc
r7401 r8858 123 123 for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it) 124 124 if ((*it)->getName() == name) 125 if ((*it)->getIndex() > size) 126 size = (*it)->getIndex(); 127 if (size == 0) 128 return 0; 129 else 130 return (size + 1); 125 if ((*it)->getIndex() >= size) 126 size = (*it)->getIndex() + 1; 127 return size; 131 128 } 132 129 … … 274 271 { 275 272 boost::filesystem::copy_file(defaultFilepath, filepath); 276 COUT(3) << "Copied " << this->filename_ << " from the default config folder." << std::endl;273 orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl; 277 274 } 278 275 catch (const boost::filesystem::filesystem_error& ex) 279 { COUT(1) << "Error in ConfigFile: " << ex.what() << std::endl; }276 { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; } 280 277 } 281 278 } … … 375 372 file.close(); 376 373 377 COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;374 orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl; 378 375 379 376 // DO NOT save the file --> we can open supposedly read only config files … … 404 401 if (!file.is_open()) 405 402 { 406 COUT(1) << "Error: Couldn't open config-file \"" << filename << "\"." << std::endl;403 orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl; 407 404 return; 408 405 } … … 410 407 for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it) 411 408 { 412 file << (*it)->getFileEntry() << std::endl;409 file << (*it)->getFileEntry() << endl; 413 410 414 411 for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries) 415 file << (*it_entries)->getFileEntry() << std::endl;416 417 file << std::endl;412 file << (*it_entries)->getFileEntry() << endl; 413 414 file << endl; 418 415 } 419 416 420 417 file.close(); 421 418 422 COUT(4) << "Saved config file \"" << filename << "\"." << std::endl;419 orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl; 423 420 } 424 421 … … 669 666 { 670 667 if (!this->configImpl(section, entry, value, &ConfigValueContainer::set)) 671 COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;668 orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl; 672 669 } 673 670 … … 682 679 { 683 680 if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset)) 684 COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;681 orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl; 685 682 } 686 683
Note: See TracChangeset
for help on using the changeset viewer.