Changeset 9406 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r9112 r9406 119 119 120 120 CmdList::const_iterator elem; 121 for (elem = cmdClass->commandList.begin(); elem != cmdClass->commandList.end(); elem++) 122 if (commandName == (*elem)->getName()) 123 return (*elem); 121 for (unsigned int i = 0; i < cmdClass->commandList.size(); i++) 122 { 123 if (commandName == cmdClass->commandList[i]->getName()) 124 return (cmdClass->commandList[i]); 125 } 124 126 return NULL; 125 127 } … … 137 139 if (likely(checkClass != NULL)) 138 140 return ShellCommand::getCommand(commandName, checkClass); 139 return NULL; 141 else 142 return NULL; 140 143 } 141 144 … … 149 152 const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin, std::vector<BaseObject*>* boList) 150 153 { 151 return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin );154 return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin, boList); 152 155 } 153 156 … … 199 202 { 200 203 // Search for Objects. 201 retCmd = ShellCommand::getCommand( strings[1], cmdClass);204 retCmd = ShellCommand::getCommand((strings.size() > 1) ? strings[1] : "", cmdClass); 202 205 if (retCmd != NULL) 203 206 { … … 210 213 if (retCmd == NULL && strings.size() >= 2) 211 214 { 212 retCmd = ShellCommand::getCommand( strings[2], cmdClass);215 retCmd = ShellCommand::getCommand((strings.size() > 2) ? strings[2] : "", cmdClass); 213 216 if (retCmd != NULL) 214 217 { … … 254 257 { 255 258 for (bo = objectList->begin(); bo != objectList->end(); bo++) 256 if ( (*bo)->getName() != NULL &&!nocaseCmp(objectDescriptor, (*bo)->getName(), objectDescriptor.size()))259 if (!nocaseCmp(objectDescriptor, (*bo)->getName(), objectDescriptor.size())) 257 260 boList->push_back(*bo); 258 261 } … … 298 301 for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo) 299 302 { 300 PRINT(0)("Command '%s' on '%s::%s'\n", sc->get Name(), (*bo)->getClassName(), (*bo)->getName());301 (*sc->executor)((*bo), inputSplits. getSubSet(paramBegin));303 PRINT(0)("Command '%s' on '%s::%s'\n", sc->getCName(), (*bo)->getClassCName(), (*bo)->getCName()); 304 (*sc->executor)((*bo), inputSplits.subSet(paramBegin)); 302 305 } 303 306 return true; … … 331 334 if (this->alias != NULL) 332 335 { 333 PRINTF(2)("not more than one Alias allowed for functions (%s::%s)\n", this->get Name(), this->shellClass->getName());336 PRINTF(2)("not more than one Alias allowed for functions (%s::%s)\n", this->getCName(), this->shellClass->getCName()); 334 337 } 335 338 else … … 369 372 { 370 373 PRINTF(1)("Parameter %d not inside of valid ParameterCount %d of Command %s::%s\n", 371 parameter, this->executor->getParamCount(), this->get Name(), this->shellClass->getName());374 parameter, this->executor->getParamCount(), this->getCName(), this->shellClass->getCName()); 372 375 } 373 376 else … … 375 378 // if(this->completors[parameter] == NULL) 376 379 // delete this->completors[parameter]; 377 // this->completors[parameter] = completorPlugin.clone(); 380 // this->completors[parameter] = completorPlugin.clone(); 378 381 } 379 382 return this; … … 385 388 void ShellCommand::help() const 386 389 { 387 PRINT(0)("%s ", this->get Name());390 PRINT(0)("%s ", this->getCName()); 388 391 } 389 392
Note: See TracChangeset
for help on using the changeset viewer.