Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Sep 17, 2005, 2:09:14 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor function, to retrieve a List of Commands from a ClassList

File:
1 edited

Legend:

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

    r5188 r5189  
    5959  delete iterator;
    6060  delete this->commandList;
     61}
     62
     63tList<const char>* ShellCommandClass::getCommandListOfClass(const char* className)
     64{
     65  tList<const char>* retList;
     66  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
     67  ShellCommandClass* elem = iterator->firstElement();
     68  while(elem != NULL)
     69  {
     70    if (!strcmp (elem->getName(), className))
     71    {
     72      tIterator<ShellCommandBase>* itFkt = elem->commandList->getIterator();
     73      ShellCommandBase* command = itFkt->firstElement();
     74      while (command != NULL)
     75      {
     76        retList->add(command->getName());
     77        command = itFkt->nextElement();
     78      }
     79      delete itFkt;
     80    }
     81
     82    elem = iterator->nextElement();
     83  }
     84  delete iterator;
     85  return retList;
    6186}
    6287
Note: See TracChangeset for help on using the changeset viewer.