Changeset 1050 for code/branches
- Timestamp:
- Apr 14, 2008, 1:27:51 AM (17 years ago)
- Location:
- code/branches/core2/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/CommandExecutor.cc
r1049 r1050 415 415 { 416 416 if (tokens.size() >= 2) 417 return evaluation.shortcut_->parse( tokens.subSet(1).join() + evaluation.getAdditionalParameter());417 return evaluation.shortcut_->parse(removeSlashes(tokens.subSet(1).join() + evaluation.getAdditionalParameter())); 418 418 else 419 return evaluation.shortcut_->parse( evaluation.additionalParameter_);419 return evaluation.shortcut_->parse(removeSlashes(evaluation.additionalParameter_)); 420 420 } 421 421 break; … … 429 429 { 430 430 if (tokens.size() >= 3) 431 return evaluation.function_->parse( tokens.subSet(2).join() + evaluation.getAdditionalParameter());431 return evaluation.function_->parse(removeSlashes(tokens.subSet(2).join() + evaluation.getAdditionalParameter())); 432 432 else 433 return evaluation.function_->parse( evaluation.additionalParameter_);433 return evaluation.function_->parse(removeSlashes(evaluation.additionalParameter_)); 434 434 } 435 435 break; … … 447 447 { 448 448 if (tokens.size() >= 4) 449 return evaluation.configvalue_->set( tokens.subSet(3).join() + evaluation.getAdditionalParameter());449 return evaluation.configvalue_->set(removeSlashes(tokens.subSet(3).join() + evaluation.getAdditionalParameter())); 450 450 else 451 return evaluation.configvalue_->set( evaluation.additionalParameter_);451 return evaluation.configvalue_->set(removeSlashes(evaluation.additionalParameter_)); 452 452 } 453 453 else if ((tokens.size() >= 1) && (tokens[0] == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) 454 454 { 455 455 if (tokens.size() >= 4) 456 return evaluation.configvalue_->tset( tokens.subSet(3).join() + evaluation.getAdditionalParameter());456 return evaluation.configvalue_->tset(removeSlashes(tokens.subSet(3).join() + evaluation.getAdditionalParameter())); 457 457 else 458 return evaluation.configvalue_->tset( evaluation.additionalParameter_);458 return evaluation.configvalue_->tset(removeSlashes(evaluation.additionalParameter_)); 459 459 } 460 460 } -
code/branches/core2/src/orxonox/core/ConfigFileManager.cc
r1049 r1050 72 72 this->value_ = value; 73 73 else 74 this->value_ = "\"" + addSlashes( value) + "\"";74 this->value_ = "\"" + addSlashes(stripEnclosingQuotes(value)) + "\""; 75 75 } 76 76 -
code/branches/core2/src/util/String.cc
r1049 r1050 254 254 std::string output = str; 255 255 256 for (unsigned int pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\\\"); }257 for (unsigned int pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\n"); }258 for (unsigned int pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\t"); }259 for (unsigned int pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\v"); }260 for (unsigned int pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\b"); }261 for (unsigned int pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\r"); }262 for (unsigned int pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\f"); }263 for (unsigned int pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\a"); }264 for (unsigned int pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\\""); }265 for (unsigned int pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 2, "\\0"); }256 for (unsigned int pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\\"); } 257 for (unsigned int pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\n"); } 258 for (unsigned int pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\t"); } 259 for (unsigned int pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\v"); } 260 for (unsigned int pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\b"); } 261 for (unsigned int pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\r"); } 262 for (unsigned int pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\f"); } 263 for (unsigned int pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\a"); } 264 for (unsigned int pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\""); } 265 for (unsigned int pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\0"); } 266 266 267 267 return output; … … 291 291 output += str[pos]; 292 292 pos++; 293 } 294 output += str[str.size() - 1]; 293 if (pos == str.size() - 1) 294 output += str[pos]; 295 } 295 296 296 297 return output;
Note: See TracChangeset
for help on using the changeset viewer.