Changeset 5329 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Oct 8, 2005, 11:07:21 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell.cc
r5256 r5329 65 65 // Element2D and generals 66 66 this->setAbsCoor2D(3, -400); 67 this->textSize = 15;67 this->textSize = 20; 68 68 this->lineSpacing = 0; 69 69 this->bActive = false; -
trunk/src/lib/shell/shell_command.cc
r5328 r5329 422 422 if (ShellCommandClass::commandClassList == NULL) 423 423 return false; 424 425 424 426 425 long classID = CL_NULL; //< the classID retrieved from the Class. … … 482 481 } 483 482 484 if (classID != CL_NULL && inputSplits.getCount() >= 2 && objectList != NULL) 485 { 486 // Checking for a Match in the Objects of classID (else take the first) 487 tIterator<BaseObject>* itBO = objectList->getIterator(); 488 BaseObject* enumBO = itBO->firstElement(); 489 while(enumBO) 483 if (commandClass != NULL && inputSplits.getCount() >= 2) 484 { 485 if (objectList != NULL) 490 486 { 491 if (enumBO->getName() != NULL && !strcasecmp(enumBO->getName(), inputSplits.getString(1))) 487 // Checking for a Match in the Objects of classID (else take the first) 488 tIterator<BaseObject>* itBO = objectList->getIterator(); 489 BaseObject* enumBO = itBO->firstElement(); 490 while(enumBO) 492 491 { 493 objectPointer = enumBO; 494 fktPos++; 495 break; 496 } 497 enumBO = itBO->nextElement(); 492 if (enumBO->getName() != NULL && !strcasecmp(enumBO->getName(), inputSplits.getString(1))) 493 { 494 objectPointer = enumBO; 495 fktPos = 2; 496 break; 497 } 498 enumBO = itBO->nextElement(); 499 } 500 delete itBO; 501 502 // 503 if (objectPointer == NULL) 504 objectPointer = objectList->firstElement(); 498 505 } 499 delete itBO; 500 501 // 502 if (objectPointer == NULL) 503 objectPointer = objectList->firstElement(); 504 506 printf("test\n"); 505 507 // match a function. 506 if (commandClass != NULL && objectPointer != NULL &&(fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3)))508 if (commandClass != NULL && (fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3))) 507 509 { 508 510 tIterator<ShellCommandBase>* itCMD = commandClass->commandList->getIterator(); … … 512 514 if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos))) 513 515 { 516 if (objectPointer == NULL && enumCMD->functorType == ShellCommand_Objective) 517 { 518 delete itCMD; 519 return false; 520 } 514 521 if (inputSplits.getCount() > fktPos+1) 515 522 enumCMD->executeCommand(objectPointer, executionString+inputSplits.getOffset(fktPos +1)); … … 622 629 623 630 return this; 624 }625 626 627 /**628 * see ShellCommandBase::debug()629 */630 void ShellCommandBase::debugDyn()631 {632 this->debug();633 631 } 634 632 -
trunk/src/lib/shell/shell_command.h
r5328 r5329 39 39 #define SHELL_COMMAND(command, class, function) \ 40 40 ShellCommandBase* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function) 41 /** 42 * an easy to use Macro to create a Command 43 * @param command the name of the command (without "" around the string) 44 * @param class the name of the class to apply this command to (without the "" around the string) 45 * @param function the function to call 46 * 47 * MEANING: 48 * ShellCommandBase* someUniqueVarName = 49 * ShellCommand<ClassName>::registerCommand("commandNameInShell", "ClassName", &ClassName::FunctionToCall); 50 * 51 * In the Shell you would call this Command using: 52 * $ ClassName [ObjectName] commandNameInShell [parameters] 53 */ 54 #define SHELL_COMMAND_STATIC(command, class, function) \ 55 ShellCommandBase* shell_command_##class##_##command = ShellCommandStatic<class>::registerCommand(#command, #class, function) 41 56 42 57 … … 110 125 static bool isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...); 111 126 static const char* paramToString(long parameter); 112 113 void debugDyn();114 127 115 128 private: -
trunk/src/lib/shell/shell_completion.cc
r5254 r5329 107 107 completeType |= SHELLC_CLASS; 108 108 completeType |= SHELLC_ALIAS; 109 110 109 } 111 110 else if (inputSplits.getCount() == 1 && emptyComplete == false)
Note: See TracChangeset
for help on using the changeset viewer.