Changeset 7420 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Apr 28, 2006, 2:22:26 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7419 r7420 98 98 for (cmd = cmdClass->commandList.begin(); cmd < cmdClass->commandList.end(); cmd++) 99 99 if (commandName == (*cmd)->getName()) 100 { 100 101 delete (*cmd); 102 break; 103 } 101 104 } 102 105 } … … 244 247 { 245 248 for (bo = objectList->begin(); bo != objectList->end(); bo++) 246 if ((*bo)->getName() != NULL && nocaseCmp(objectDescriptor, (*bo)->getName(), objectDescriptor.size()))249 if ((*bo)->getName() != NULL && !nocaseCmp(objectDescriptor, (*bo)->getName(), objectDescriptor.size())) 247 250 boList->push_back(*bo); 248 251 } … … 274 277 bool ShellCommand::execute(const std::string& executionString) 275 278 { 279 SubString inputSplits(executionString, SubString::WhiteSpacesWithComma); 280 281 // if we do not have any input return 282 if (inputSplits.empty()) 283 return false; 284 285 unsigned int paramBegin; 286 const ShellCommand* sc; 287 std::vector<BaseObject*> boList; 288 sc = getCommandFromInput(inputSplits, paramBegin, &boList); 289 if (sc != NULL) 290 { 291 PRINT(0)("Command %s on ", sc->getName()); 292 for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo) 293 { 294 PRINT(0)("%s::%s\n", (*bo)->getClassName(), (*bo)->getName()); 295 (*sc->executor)((*bo), inputSplits.getSubSet(paramBegin).join()); 296 } 297 return true; 298 } 299 return false; 300 301 302 /* 276 303 long classID = CL_NULL; //< the classID retrieved from the Class. 277 304 ShellCommandClass* commandClass = NULL; //< the command class this command applies to. … … 281 308 // long completeType = SHELLC_NONE; //< the Type we'd like to complete. 282 309 283 SubString inputSplits(executionString, SubString::WhiteSpacesWithComma); 284 285 // if we do not have any input return 286 if (inputSplits.empty()) 287 return false; 288 289 unsigned int paramBegin; 290 const ShellCommand* sc; 291 std::vector<BaseObject*> boList; 292 sc = getCommandFromInput(inputSplits, paramBegin, &boList); 293 if (sc != NULL) 294 { 295 PRINT(0)("Command %s on ", sc->getName()); 296 for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo) 297 PRINT(0)("%s::%s\n", (*bo)->getClassName(), (*bo)->getName()); 298 } 310 299 311 300 312 // if we only have one input (!MUST BE AN ALIAS) … … 374 386 } 375 387 return false; 388 */ 376 389 } 377 390
Note: See TracChangeset
for help on using the changeset viewer.