Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5181 in orxonox.OLD for trunk/src/lib/shell/shell_completion.cc


Ignore:
Timestamp:
Sep 14, 2005, 12:07:06 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: partial Completion in the ShellInput again (show but no Completion)

File:
1 edited

Legend:

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

    r5178 r5181  
    1818#include "shell_completion.h"
    1919
     20#include "shell_input.h"
     21
    2022#include "base_object.h"
    2123#include "class_list.h"
     
    3335ShellCompletion::ShellCompletion ()
    3436{
    35 // this->setClassID(CL_PROTO_ID, "ProtoClass");
    36 
    37    /* If you make a new class, what is most probably the case when you write this file
    38       don't forget to:
    39        1. Add the new file new_class.cc to the ./src/Makefile.am
    40        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    41 
    42       Advanced Topics:
    43       - if you want to let your object be managed via the ObjectManager make sure to read
    44         the object_manager.h header comments. You will use this most certanly only if you
    45         make many objects of your class, like a weapon bullet.
    46    */
     37  this->completionList = NULL;
    4738}
    4839
     
    5445{
    5546  // delete what has to be deleted here
     47  if (this->completionList)
     48  {
     49    delete this->completionList;
     50  }
    5651}
    5752
     
    6459 * @todo implement it!!
    6560 */
    66 bool ShellCompletion::autoComplete(const char* inputLine)
     61bool ShellCompletion::autoComplete(ShellInput* input)
    6762{
    6863  //PRINTF(3)("AutoCompletion not implemented yet\n");
    6964
    70   char* completionLine = new char[strlen(inputLine)+1];
    71   strcpy(completionLine, inputLine);
     65  char* completionLine = new char[strlen(input->getText())+1];
     66  strcpy(completionLine, input->getText());
    7267
    7368  char* commandBegin = strrchr(completionLine, ' ');
Note: See TracChangeset for help on using the changeset viewer.