- Timestamp:
- Dec 28, 2007, 12:56:17 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc
r703 r704 647 647 648 648 /** 649 @brief Sets the value of the variable back to the default value .649 @brief Sets the value of the variable back to the default value and resets the config-file entry. 650 650 */ 651 651 void ConfigValueContainer::resetConfigValue() 652 652 { 653 parseSting(this->defvalueString_); 653 this->parseSting(this->defvalueString_); 654 this->resetConfigFileEntry(); 654 655 } 655 656 … … 854 855 void ConfigValueContainer::readConfigFile(const std::string& filename) 855 856 { 856 ConfigValueContainer::finishedReadingConfigFile(true);857 858 857 // This creates the file if it's not existing 859 858 std::ofstream createFile; … … 865 864 file.open(filename.c_str(), std::fstream::in); 866 865 866 if (!file.is_open()) 867 { 868 COUT(1) << "Error: Couldn't open config-file " << filename << " to read the config values!" << std::endl; 869 return; 870 } 871 867 872 char line[1024]; 868 873 … … 887 892 888 893 file.close(); 894 895 ConfigValueContainer::finishedReadingConfigFile(true); 889 896 } 890 897 … … 903 910 file.open(filename.c_str(), std::fstream::out); 904 911 912 if (!file.is_open()) 913 { 914 COUT(1) << "Error: Couldn't open config-file " << filename << " to write the config values!" << std::endl; 915 return; 916 } 917 905 918 // Iterate through the list an write the lines into the file 906 919 std::list<std::string>::iterator it; 907 for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it)920 for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it) 908 921 { 909 922 file << (*it) << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.