Changeset 7389 in orxonox.OLD for trunk/src/lib/shell/shell_command_class.cc
- Timestamp:
- Apr 26, 2006, 11:39:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command_class.cc
r7388 r7389 26 26 namespace OrxShell 27 27 { 28 29 28 std::list<ShellCommandClass*>* ShellCommandClass::commandClassList = NULL; 30 std::list<ShellCommandAlias*>* ShellCommandClass::aliasList = NULL;31 29 32 30 /** … … 79 77 80 78 /** 81 * collects the Aliases registered to the ShellCommands 82 * @param stringList a List to paste the Aliases into. 83 * @returns true on success, false otherwise 84 */ 85 bool ShellCommandClass::getCommandListOfAlias(std::list<std::string>& stringList) 86 { 87 if (ShellCommandClass::aliasList == NULL) 88 return false; 89 90 std::list<ShellCommandAlias*>::iterator alias; 91 for (alias = ShellCommandClass::aliasList->begin(); alias != ShellCommandClass::aliasList->end(); alias++) 92 stringList.push_back((*alias)->getName()); 93 return true; 94 } 95 96 /** 97 * unregisters all Commands that exist 79 * @brief unregisters all Commands that exist 98 80 */ 99 81 void ShellCommandClass::unregisterAllCommands() … … 109 91 } 110 92 111 // unregister all aliases (there should be nothing to do here :)) 112 if (ShellCommandClass::aliasList != NULL) 113 { 114 std::list<ShellCommandAlias*>::iterator alias; 115 for (alias = ShellCommandClass::aliasList->begin(); alias != ShellCommandClass::aliasList->end(); alias++) 116 delete (*alias); 117 delete ShellCommandClass::aliasList; 118 ShellCommandClass::aliasList = NULL; 119 } 120 } 121 122 /** 123 * checks if a Class is already registered to the Commands' class-stack 93 } 94 95 /** 96 * @brief checks if a Class is already registered to the Commands' class-stack 124 97 * @param className the Name of the Class to check for 125 98 * @returns the CommandClass if found, NULL otherwise … … 222 195 { 223 196 std::vector<ShellCommand*>::iterator delC = std::find(this->commandList.begin(), this->commandList.end(), command); 224 this->commandList.erase(delC); 197 if (delC != this->commandList.end()) 198 this->commandList.erase(delC); 225 199 } 226 200
Note: See TracChangeset
for help on using the changeset viewer.