Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9406 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r9112 r9406  
    119119
    120120    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    }
    124126    return NULL;
    125127  }
     
    137139    if (likely(checkClass != NULL))
    138140      return ShellCommand::getCommand(commandName, checkClass);
    139     return NULL;
     141    else
     142      return NULL;
    140143  }
    141144
     
    149152  const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin, std::vector<BaseObject*>* boList)
    150153  {
    151     return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin);
     154    return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin, boList);
    152155  }
    153156
     
    199202      {
    200203        // Search for Objects.
    201         retCmd = ShellCommand::getCommand(strings[1], cmdClass);
     204        retCmd = ShellCommand::getCommand((strings.size() > 1) ? strings[1] : "", cmdClass);
    202205        if (retCmd != NULL)
    203206        {
     
    210213      if (retCmd == NULL && strings.size() >= 2)
    211214      {
    212         retCmd = ShellCommand::getCommand(strings[2], cmdClass);
     215        retCmd = ShellCommand::getCommand((strings.size() > 2) ? strings[2] : "", cmdClass);
    213216        if (retCmd != NULL)
    214217        {
     
    254257      {
    255258        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()))
    257260            boList->push_back(*bo);
    258261      }
     
    298301      for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
    299302      {
    300         PRINT(0)("Command '%s' on '%s::%s'\n", sc->getName(), (*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));
    302305      }
    303306      return true;
     
    331334    if (this->alias != NULL)
    332335    {
    333       PRINTF(2)("not more than one Alias allowed for functions (%s::%s)\n", this->getName(), this->shellClass->getName());
     336      PRINTF(2)("not more than one Alias allowed for functions (%s::%s)\n", this->getCName(), this->shellClass->getCName());
    334337    }
    335338    else
     
    369372    {
    370373      PRINTF(1)("Parameter %d not inside of valid ParameterCount %d of Command %s::%s\n",
    371                 parameter, this->executor->getParamCount(), this->getName(), this->shellClass->getName());
     374                parameter, this->executor->getParamCount(), this->getCName(), this->shellClass->getCName());
    372375    }
    373376    else
     
    375378//       if(this->completors[parameter] == NULL)
    376379//       delete this->completors[parameter];
    377 //       this->completors[parameter] = completorPlugin.clone(); 
     380//       this->completors[parameter] = completorPlugin.clone();
    378381    }
    379382    return this;
     
    385388  void ShellCommand::help() const
    386389  {
    387     PRINT(0)("%s ", this->getName());
     390    PRINT(0)("%s ", this->getCName());
    388391  }
    389392
Note: See TracChangeset for help on using the changeset viewer.