Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7409 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Apr 27, 2006, 9:31:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: first CompletionPlugin works almost :)

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

Legend:

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

    r7408 r7409  
    114114    if (likely(checkClass != NULL))
    115115    {
     116      printf("TEST\n");
    116117      std::vector<ShellCommand*>::const_iterator elem;
    117118      for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++)
    118       {
    119119        if (commandName == (*elem)->getName())
    120120        {
     
    122122          return (*elem);
    123123        }
    124       }
    125       return NULL;
    126     }
    127     else
    128       return NULL;
     124    }
     125   return NULL;
    129126  }
    130127
  • trunk/src/lib/shell/shell_command.h

    r7408 r7409  
    7575    static bool exists(const std::string& commandName, const std::string& className);
    7676
     77    const ShellCommandClass* const getCommandClass() const { return this->shellClass; };
     78    const ShellCommandAlias* const getAlias() const { return this->alias; }
    7779    unsigned int getParamCount() const { return this->executor->getParamCount(); }
    7880    const CompletorPlugin* const getCompletorPlugin(unsigned int i) const { return this->completors[i]; };
  • trunk/src/lib/shell/shell_completion.cc

    r7408 r7409  
    105105      this->objectComplete(completeString, classID);
    106106    if (completeType & FunctionCompletion)
    107       this->commandComplete(completeString, inputSplits.getString(0));
     107      this->commandComplete(completeString, inputSplits[0]);
    108108    if (completeType & AliasCompletion)
    109109      this->aliasComplete(completeString);
     
    111111    if (completeType == NullCompletion)
    112112    {
    113       printf("Completing a Parameter\n");
    114 //      ShellCommand::
     113      const ShellCommand* sc = ShellCommand::getCommand(inputSplits[2], inputSplits[0]);
     114      if (sc != NULL)
     115      {
     116        std::vector<std::string> test;
     117        sc->getCompletorPlugin(0)->addToCompleteList(test, inputSplits[inputSplits.size()-1]);
     118      }
    115119    }
    116120
  • trunk/src/lib/shell/shell_completion_plugin.cc

    r7407 r7409  
    3333  void CompletorDefault::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) const
    3434  {
    35     PRINT(0)("%s", MultiType::MultiTypeToString(this->_value->getType()).c_str());
     35    PRINT(0)("Requires '%s'\n", MultiType::MultiTypeToString(this->_value->getType()).c_str());
    3636  }
    3737
Note: See TracChangeset for help on using the changeset viewer.