- Timestamp:
- Aug 28, 2010, 1:25:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.cc
r7233 r7235 197 197 this->retrievePossibleArguments(); 198 198 199 if ( !this->possibleArguments_.empty())199 if (CommandEvaluation::getSize(this->possibleArguments_) > 0 || (!this->possibleArguments_.empty() && this->isValid())) 200 200 return CommandEvaluation::dump(this->possibleArguments_); 201 201 … … 256 256 } 257 257 } 258 } 259 260 /* static */ size_t CommandEvaluation::getSize(const ArgumentCompletionList& list) 261 { 262 size_t count = 0; 263 for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it) 264 if (it->getComparable() != "") 265 ++count; 266 return count; 258 267 } 259 268 … … 294 303 } 295 304 } 296 }297 298 /* static */ size_t CommandEvaluation::getSize(const ArgumentCompletionList& list)299 {300 size_t count = 0;301 for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it)302 if (it->getComparable() != "")303 ++count;304 return count;305 }306 307 /* static */ std::string CommandEvaluation::dump(const ArgumentCompletionList& list)308 {309 std::string output;310 for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it)311 {312 output += it->getDisplay();313 314 if (it->getComparable() != "")315 output += ' ';316 }317 return output;318 }319 320 /* static */ std::string CommandEvaluation::dump(const _ConsoleCommand* command)321 {322 std::string output = command->getName();323 if (command->getExecutor()->getParamCount() > 0)324 output += ": ";325 326 for (unsigned int i = 0; i < command->getExecutor()->getParamCount(); i++)327 {328 if (i != 0)329 output += ' ';330 331 if (command->getExecutor()->defaultValueSet(i))332 output += '[';333 else334 output += '{';335 336 output += command->getExecutor()->getTypenameParam(i);337 338 if (command->getExecutor()->defaultValueSet(i))339 output += '=' + command->getExecutor()->getDefaultValue(i).getString() + ']';340 else341 output += '}';342 }343 return output;344 305 } 345 306 … … 405 366 } 406 367 } 368 369 /* static */ std::string CommandEvaluation::dump(const ArgumentCompletionList& list) 370 { 371 std::string output; 372 for (ArgumentCompletionList::const_iterator it = list.begin(); it != list.end(); ++it) 373 { 374 output += it->getDisplay(); 375 376 if (it->getComparable() != "") 377 output += ' '; 378 } 379 return output; 380 } 381 382 /* static */ std::string CommandEvaluation::dump(const _ConsoleCommand* command) 383 { 384 std::string output = command->getName(); 385 if (command->getExecutor()->getParamCount() > 0) 386 output += ": "; 387 388 for (unsigned int i = 0; i < command->getExecutor()->getParamCount(); i++) 389 { 390 if (i != 0) 391 output += ' '; 392 393 if (command->getExecutor()->defaultValueSet(i)) 394 output += '['; 395 else 396 output += '{'; 397 398 output += command->getExecutor()->getTypenameParam(i); 399 400 if (command->getExecutor()->defaultValueSet(i)) 401 output += '=' + command->getExecutor()->getDefaultValue(i).getString() + ']'; 402 else 403 output += '}'; 404 } 405 return output; 406 } 407 407 }
Note: See TracChangeset
for help on using the changeset viewer.