- Timestamp:
- Dec 22, 2009, 2:07:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/ConfigFileManager.cc
r6387 r6394 99 99 this->value_ = value; 100 100 else 101 this->value_ = "\"" + addSlashes(stripEnclosingQuotes(value)) + "\"";101 this->value_ = '"' + addSlashes(stripEnclosingQuotes(value)) + '"'; 102 102 } 103 103 … … 112 112 std::string ConfigFileEntryValue::getFileEntry() const 113 113 { 114 if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)115 return (this->name_ + "="+ this->value_);116 else 117 return (this->name_ + "="+ this->value_ + " " + this->additionalComment_);114 if (this->additionalComment_.empty()) 115 return (this->name_ + '=' + this->value_); 116 else 117 return (this->name_ + '=' + this->value_ + " " + this->additionalComment_); 118 118 } 119 119 … … 124 124 std::string ConfigFileEntryVectorValue::getFileEntry() const 125 125 { 126 if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)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_);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_); 130 130 } 131 131 … … 171 171 std::string ConfigFileSection::getFileEntry() const 172 172 { 173 if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)174 return ( "[" + this->name_ + "]");175 else 176 return ( "["+ this->name_ + "] " + this->additionalComment_);173 if (this->additionalComment_.empty()) 174 return ('[' + this->name_ + ']'); 175 else 176 return ('[' + this->name_ + "] " + this->additionalComment_); 177 177 } 178 178 … … 251 251 std::getline(file, line); 252 252 253 std::stringtemp = getStripped(line);253 const std::string& temp = getStripped(line); 254 254 if (!isEmpty(temp) && !isComment(temp)) 255 255 { … … 261 261 { 262 262 // New section 263 std::stringcomment = line.substr(pos2 + 1);263 const std::string& comment = line.substr(pos2 + 1); 264 264 if (isComment(comment)) 265 265 newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment); … … 293 293 commentposition = getNextCommentPosition(line, commentposition + 1); 294 294 } 295 std::string value = "", comment = "";295 std::string value, comment; 296 296 if (commentposition == std::string::npos) 297 297 {
Note: See TracChangeset
for help on using the changeset viewer.