Changeset 5195 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc
- Timestamp:
- Sep 18, 2005, 2:13:28 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r5192 r5195 41 41 this->classID = CL_NULL; 42 42 this->commandList = new tList<ShellCommandBase>; 43 this->aliasList = new tList<ShellCommandAlias>; 43 44 44 45 ShellCommandClass::commandClassList->add(this); … … 88 89 } 89 90 91 bool ShellCommandClass::getCommandListOfAlias(tList<const char>* stringList) 92 { 93 if (stringList == NULL) 94 return false; 95 96 tIterator<ShellCommandAlias>* iterator = ShellCommandClass::aliasList->getIterator(); 97 ShellCommandAlias* elem = iterator->firstElement(); 98 while(elem != NULL) 99 { 100 stringList->add(elem->getName()); 101 elem = iterator->nextElement(); 102 } 103 delete iterator; 104 return true; 105 } 106 107 90 108 /** 91 109 * unregisters all Commands that exist … … 93 111 void ShellCommandClass::unregisterAllCommands() 94 112 { 113 // unregister all commands 95 114 tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator(); 96 115 ShellCommandClass* elem = iterator->firstElement(); … … 105 124 delete ShellCommandClass::commandClassList; 106 125 ShellCommandClass::commandClassList = NULL; 126 127 // unregister all aliases (there should be nothing to do here :)) 128 tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator(); 129 ShellCommandAlias* elemAL = itAL->firstElement(); 130 while(elemAL != NULL) 131 { 132 delete elemAL; 133 elemAL = itAL->nextElement(); 134 } 135 delete itAL; 136 delete ShellCommandClass::aliasList; 137 ShellCommandClass::aliasList = NULL; 107 138 } 108 139 … … 168 199 169 200 tList<ShellCommandClass>* ShellCommandClass::commandClassList = NULL; 201 tList<ShellCommandAlias>* ShellCommandClass::aliasList = NULL; 170 202 171 203 /** … … 428 460 } 429 461 462 ShellCommandBase* ShellCommandBase::setAlias(const char* alias) 463 { 464 ShellCommandAlias* aliasCMD = new ShellCommandAlias(alias, this); 465 ShellCommandClass::aliasList->add(aliasCMD); 466 } 467 430 468 /** 431 469 * see ShellCommandBase::debug()
Note: See TracChangeset
for help on using the changeset viewer.