Changeset 6425 for code/trunk/src/libraries/core/ConfigFileManager.cc
- Timestamp:
- Dec 27, 2009, 2:30:06 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/ConfigFileManager.cc
r6422 r6425 58 58 } 59 59 60 std::stringgetConfig(const std::string& classname, const std::string& varname)60 const std::string& getConfig(const std::string& classname, const std::string& varname) 61 61 { 62 62 return ConfigFileManager::getInstance().getValue(ConfigFileType::Settings, classname, varname, "", true); … … 94 94 ////////////////////////// 95 95 96 void ConfigFileEntryValue::setValue(const std::string& value) 97 { 98 if (!this->bString_) 99 this->value_ = value; 96 void ConfigFileEntryValue::update() 97 { 98 // Make sure we remove the quotes when bString changes 99 if (this->bString_) 100 this->value_ = stripEnclosingQuotes(this->value_); 101 // Assemble the entry line 102 this->fileEntry_ = this->getKeyString() + " = "; 103 if (this->bString_) 104 this->fileEntry_ += '"' + addSlashes(this->value_) + '"'; 100 105 else 101 this->value_ = '"' + addSlashes(stripEnclosingQuotes(value)) + '"'; 102 } 103 104 std::string ConfigFileEntryValue::getValue() const 105 { 106 if (!this->bString_) 107 return this->value_; 108 else 109 return removeSlashes(stripEnclosingQuotes(this->value_)); 110 } 111 112 std::string ConfigFileEntryValue::getFileEntry() const 113 { 114 if (this->additionalComment_.empty()) 115 return (this->name_ + '=' + this->value_); 116 else 117 return (this->name_ + '=' + this->value_ + " " + this->additionalComment_); 106 this->fileEntry_ += this->value_; 107 if (!this->additionalComment_.empty()) 108 this->fileEntry_ += ' ' + this->additionalComment_; 118 109 } 119 110 … … 122 113 // ConfigFileEntryVectorValue // 123 114 //////////////////////////////// 124 std::string ConfigFileEntryVectorValue::getFileEntry() const 125 { 126 if (this->additionalComment_.empty()) 127 return (this->name_ + '[' + multi_cast<std::string>(this->index_) + ']' + '=' + this->value_); 128 else 129 return (this->name_ + '[' + multi_cast<std::string>(this->index_) + "]=" + this->value_ + ' ' + this->additionalComment_); 115 void ConfigFileEntryVectorValue::update() 116 { 117 this->keyString_ = this->name_ + '[' + multi_cast<std::string>(this->index_) + ']'; 118 ConfigFileEntryValue::update(); 130 119 } 131 120
Note: See TracChangeset
for help on using the changeset viewer.