Changeset 6417 for code/trunk/src/libraries/core/CommandEvaluation.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/CommandEvaluation.cc
r5781 r6417 50 50 this->commandTokens_.split(command, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0'); 51 51 52 this->additionalParameter_ = "";52 this->additionalParameter_.clear(); 53 53 54 54 this->bEvaluatedParams_ = false; … … 60 60 this->functionclass_ = 0; 61 61 this->function_ = 0; 62 this->possibleArgument_ = "";63 this->argument_ = "";64 65 this->errorMessage_ = "";62 this->possibleArgument_.clear(); 63 this->argument_.clear(); 64 65 this->errorMessage_.clear(); 66 66 this->state_ = CommandState::Empty; 67 67 } … … 79 79 if (this->bEvaluatedParams_ && this->function_) 80 80 { 81 COUT(6) << "CE_execute (evaluation): " << this->function_->getName() << " " << this->param_[0] << " " << this->param_[1] << " " << this->param_[2] << " " << this->param_[3] << " "<< this->param_[4] << std::endl;81 COUT(6) << "CE_execute (evaluation): " << this->function_->getName() << ' ' << this->param_[0] << ' ' << this->param_[1] << ' ' << this->param_[2] << ' ' << this->param_[3] << ' ' << this->param_[4] << std::endl; 82 82 (*this->function_)(this->param_[0], this->param_[1], this->param_[2], this->param_[3], this->param_[4]); 83 83 return true; … … 98 98 } 99 99 100 std::stringCommandEvaluation::complete()100 const std::string& CommandEvaluation::complete() 101 101 { 102 102 if (!this->bNewCommand_) … … 114 114 return (this->command_ = this->function_->getName()); 115 115 else 116 return (this->command_ = this->function_->getName() + " ");116 return (this->command_ = this->function_->getName() + ' '); 117 117 } 118 118 else if (this->functionclass_) 119 return (this->command_ = this->functionclass_->getName() + " ");119 return (this->command_ = this->functionclass_->getName() + ' '); 120 120 break; 121 121 case CommandState::Function: … … 123 123 { 124 124 if (this->function_->getParamCount() == 0) 125 return (this->command_ = this->functionclass_->getName() + " "+ this->function_->getName());125 return (this->command_ = this->functionclass_->getName() + ' ' + this->function_->getName()); 126 126 else 127 return (this->command_ = this->functionclass_->getName() + " " + this->function_->getName() + " ");127 return (this->command_ = this->functionclass_->getName() + ' ' + this->function_->getName() + ' '); 128 128 } 129 129 break; … … 131 131 case CommandState::Params: 132 132 { 133 if (this->argument_ == "" && this->possibleArgument_ == "")133 if (this->argument_.empty() && this->possibleArgument_.empty()) 134 134 break; 135 135 … … 137 137 if (this->command_[this->command_.size() - 1] != ' ') 138 138 maxIndex -= 1; 139 std::string whitespace = "";140 141 if ( this->possibleArgument_ != "")139 std::string whitespace; 140 141 if (!this->possibleArgument_.empty()) 142 142 { 143 143 this->argument_ = this->possibleArgument_; … … 146 146 } 147 147 148 return (this->command_ = this->commandTokens_.subSet(0, maxIndex).join() + " "+ this->argument_ + whitespace);148 return (this->command_ = this->commandTokens_.subSet(0, maxIndex).join() + ' ' + this->argument_ + whitespace); 149 149 break; 150 150 } … … 262 262 std::string CommandEvaluation::dump(const std::list<std::pair<const std::string*, const std::string*> >& list) 263 263 { 264 std::string output = "";264 std::string output; 265 265 for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it) 266 266 { 267 267 if (it != list.begin()) 268 output += " ";269 270 output += *( *it).second;268 output += ' '; 269 270 output += *(it->second); 271 271 } 272 272 return output; … … 275 275 std::string CommandEvaluation::dump(const ArgumentCompletionList& list) 276 276 { 277 std::string output = "";277 std::string output; 278 278 for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it) 279 279 { 280 280 if (it != list.begin()) 281 output += " ";282 283 output += (*it).getDisplay();281 output += ' '; 282 283 output += it->getDisplay(); 284 284 } 285 285 return output; … … 295 295 { 296 296 if (i != 0) 297 output += " ";297 output += ' '; 298 298 299 299 if (command->defaultValueSet(i)) 300 output += "[";300 output += '['; 301 301 else 302 output += "{";302 output += '{'; 303 303 304 304 output += command->getTypenameParam(i); 305 305 306 306 if (command->defaultValueSet(i)) 307 output += "=" + command->getDefaultValue(i).getString() + "]";307 output += '=' + command->getDefaultValue(i).getString() + ']'; 308 308 else 309 output += "}";309 output += '}'; 310 310 } 311 311 return output;
Note: See TracChangeset
for help on using the changeset viewer.