Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Sep 15, 2005, 10:09:02 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: simple ClassCompletion… had to sleep about it… now i've got to learn

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

Legend:

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

    r5183 r5184  
    6363bool ShellCompletion::autoComplete(ShellInput* input)
    6464{
    65   char* completionLine;
     65  const char* completionLine;
    6666
    6767  long classID;         //< the classID retrieved from the Class.
     
    7575  if (input != NULL)
    7676    this->input = input;
    77 
    78   SubString(input->getText(), true).debug();
     77  if (this->input == NULL)
     78    return false;
     79  if (this->input->getText() == NULL)
     80    return this->classComplete("");
     81
     82  completionLine = this->input->getText() + strspn(this->input->getText(), " \t\n");
     83
     84  SubString inputSplits(completionLine, true);
     85
     86  if (inputSplits.getCount() == 0)
     87  {
     88//    this->classComplete("");
     89    return false;
     90  }
     91  else if (inputSplits.getCount() == 1 && strlen(inputSplits.getString(0)) == strlen(completionLine))
     92  {
     93//    this->classComplete(inputSplits.getString(0));
     94
     95  }
     96
     97  if (inputSplits.getCount() > 1)
     98  {
     99
     100  }
    79101
    80102/*  completionLine = new char[strlen(this->input->getText())+1];
  • trunk/src/lib/shell/shell_completion.h

    r5183 r5184  
    2222  virtual ~ShellCompletion();
    2323
    24   bool autoComplete(ShellInput* input);
     24  bool autoComplete(ShellInput* input = NULL);
    2525  bool classComplete(const char* classBegin);
    2626  long classMatch(const char* input, unsigned int* length);
  • trunk/src/lib/shell/shell_input.cc

    r5182 r5184  
    5353    evh->subscribe(this, ES_SHELL, i);
    5454
    55   this->completion = new ShellCompletion;
     55  this->completion = new ShellCompletion(this);
    5656}
    5757
     
    210210      this->debug();
    211211    else if (event.type == SDLK_TAB)
    212       this->completion->autoComplete(this);
     212      this->completion->autoComplete();
    213213    else if (event.type == SDLK_BACKSPACE)
    214214    {
Note: See TracChangeset for help on using the changeset viewer.