Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7373 in orxonox.OLD for trunk


Ignore:
Timestamp:
Apr 26, 2006, 2:29:15 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: list to vector

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

Legend:

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

    r7372 r7373  
    2323
    2424#include "substring.h"
    25 #include "base_object.h"
    2625#include "class_list.h"
    2726#include "debug.h"
    28 
    29 #include "stdlibincl.h"
    3027
    3128using namespace std;
     
    221218
    222219  CompletionType changeType = NullCompletion;
    223   list<CompletionElement>::iterator charIT;
     220  std::vector<CompletionElement>::iterator charIT;
    224221  for (charIT = completionList.begin(); charIT != completionList.end(); charIT++)
    225222  {
  • trunk/src/lib/shell/shell_completion.h

    r7372 r7373  
    1010#define _SHELL_COMPLETION_H
    1111
     12#include <vector>
    1213#include <list>
    1314#include <string>
     
    2122
    2223
    23 //! A class for ...
    24 class ShellCompletion {
     24//! A class for Completing the an InputString.
     25class ShellCompletion
     26{
    2527
    2628  //! an enumerator for different types the Shell can complete.
     
    3335  } CompletionType;
    3436
    35 //! A struct for ShellElements (these are used as containers to identify an Input for what it is)
    36   struct CompletionElement{
     37  //! A struct for ShellElements (these are used as containers to identify an Input for what it is)
     38  struct CompletionElement
     39  {
    3740    std::string     name;     //!< the Name of the Element to be completed.
    3841    CompletionType type;     //!< the type of the Element
    3942  };
    4043
    41  public:
     44public:
    4245  ShellCompletion();
    4346  virtual ~ShellCompletion();
    4447
     48
     49  // Functions to produce the Complete Lists.
    4550  bool autoComplete(std::string& input);
    4651  bool classComplete(const std::string& classBegin);
    47 //  long classMatch(const char* input, unsigned int* length);
     52  //  long classMatch(const char* input, unsigned int* length);
    4853  bool objectComplete(const std::string& objectBegin, long classID);
    49 //  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
     54  //  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
    5055  bool functionComplete(const std::string& functionBegin, const std::string& className);
    51 //  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
     56  //  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
    5257  bool aliasComplete(const std::string& aliasBegin);
    5358
     
    6166  void clearCompletionList();
    6267
     68
     69  // Helpers.
    6370  static const std::string& ShellCompletion::typeToString(ShellCompletion::CompletionType type);
    6471
    65  private:
    66    std::list<CompletionElement>    completionList;          //!< A list of completions, that are io.
     72private:
     73  std::vector<CompletionElement>  completionList;          //!< A list of completions, that are io.
    6774
    68 
    69    static const std::string        typeNames[];             //!< A list of Completion-Type-Names.
     75  static const std::string        typeNames[];             //!< A list of Completion-Type-Names.
    7076};
    7177
Note: See TracChangeset for help on using the changeset viewer.