Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5330 in orxonox.OLD for trunk/src/lib/shell


Ignore:
Timestamp:
Oct 8, 2005, 11:13:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: autocompletion now also works for Static Function-commandos

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

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

    r5329 r5330  
    120120    classID = ClassList::StringToID(inputSplits.getString(0));
    121121    objectList = ClassList::getList(classID);
    122     if (classID == CL_NULL)
    123       return false;
    124     else
    125     {
    126       if (objectList != NULL && objectList->getSize() == 1)
    127         completeType |= SHELLC_FUNCTION;
     122    if (classID != CL_NULL)
    128123      completeType |= SHELLC_OBJECT;
    129     }
     124    //if (objectList != NULL && objectList->getSize() == 1)
     125      completeType |= SHELLC_FUNCTION;
    130126  }
    131127  else if ((inputSplits.getCount() == 2 && emptyComplete == true) ||
     
    144140    this->objectComplete(completeString, classID);
    145141  if (completeType & SHELLC_FUNCTION)
    146     this->functionComplete(completeString, classID);
     142    this->functionComplete(completeString, inputSplits.getString(0));
    147143  if (completeType & SHELLC_ALIAS)
    148144    this->aliasComplete(completeString);
     
    202198 * @param classID the class' ID to complete the function of
    203199 */
    204 bool ShellCompletion::functionComplete(const char* functionBegin, long classID)
     200bool ShellCompletion::functionComplete(const char* functionBegin, const char* className)
    205201{
    206202  if (unlikely(functionBegin == NULL))
    207203    return false;
    208204  tList<const char> fktList;
    209   ShellCommandClass::getCommandListOfClass(ClassList::IDToString(classID), &fktList);
     205  ShellCommandClass::getCommandListOfClass(className, &fktList);
    210206  //printf("%s\n", boList->firstElement()->getName());
    211207  if (!this->addToCompleteList(&fktList, functionBegin, SHELLC_FUNCTION))
  • trunk/src/lib/shell/shell_completion.h

    r5245 r5330  
    4242  bool objectComplete(const char* objectBegin, long classID);
    4343//  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
    44   bool functionComplete(const char* functionBegin, long classID);
     44  bool functionComplete(const char* functionBegin, const char* className);
    4545//  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
    4646  bool aliasComplete(const char* aliasBegin);
Note: See TracChangeset for help on using the changeset viewer.