Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7377 in orxonox.OLD for trunk


Ignore:
Timestamp:
Apr 26, 2006, 11:32:57 AM (19 years ago)
Author:
bensch
Message:

work flush

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.h

    r7375 r7377  
    1616
    1717#define         SHELL_DEFAULT_FONT              "fonts/final_frontier.ttf"
    18 #define         SHELL_DEFAULT_TEXT_COLOR        1.0f, 0.0f, 0.0f, 1.0f
     18#define         SHELL_DEFAULT_TEXT_COLOR        0.0f, 1.0f, 0.0f, 1.0f
    1919#define         SHELL_DEFAULT_BACKGROUND_COLOR  0.0f, 0.0f, 0.0f, 1.0f
    2020
  • trunk/src/lib/shell/shell_completion_plugin.cc

    r7374 r7377  
    2929
    3030
    31 
    32   void ShellCompletorStringArray::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
     31  void CompletorStringArray::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
    3332  {
    3433    unsigned int inputLen = completionBegin.size();
     
    3736        completionList.push_back(this->_stringArray[i]);
    3837  }
    39 };
    4038
     39  CompletorFileSystem::CompletorFileSystem(const std::string& fileExtension,
     40      StartDirectory startDir,
     41      const std::string& subDir)
     42  : _fileExtension(fileExtension), _startDir(startDir), _subDir(subDir)
     43  {  }
     44
     45  void CompletorFileSystem::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
     46  {
     47    if (completionBegin.empty()) // if we do not yet have the beginning of the line, start with the chosen startDir.
     48    {
     49
     50
     51    }
     52  }
     53
     54}
     55
  • trunk/src/lib/shell/shell_completion_plugin.h

    r7374 r7377  
    1313namespace OrxShell
    1414{
    15   class ShellCompletor
     15  //! The Base of All Completors
     16  class Completor
    1617  {
    17   public:
    18     virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0;
    19     virtual ~ShellCompletor() { };
     18    public:
     19      virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0;
     20      virtual ~Completor() { };
    2021
    21   protected:
    22     ShellCompletor();
     22    protected:
     23      Completor();
    2324  };
    2425
    25   class ShellCompletorStringArray : public ShellCompletor
     26  //! Completor that completes static Arrays of Strings.
     27  class CompletorStringArray : public Completor
    2628  {
    27   public:
    28     ShellCompletorStringArray(const std::string* stringArray, unsigned int size)
    29       : _stringArray(stringArray), _size(size) {};
    30     virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin);
     29    public:
     30      CompletorStringArray(const std::string* stringArray, unsigned int size)
     31          : _stringArray(stringArray), _size(size) {};
     32      virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin);
    3133
    32   private:
    33     const std::string*   _stringArray;
    34     unsigned int         _size;
     34    private:
     35      const std::string*   _stringArray;
     36      unsigned int         _size;
     37  };
     38
     39  //! Completor that completes FileSystem Entries.
     40  class CompletorFileSystem : public Completor
     41  {
     42
     43    public:
     44      // Where to search if the completionString is empty.
     45      typedef enum
     46      {
     47        StartAtRoot,
     48        StartAtHome,
     49        StartAtDataDir,
     50    } StartDirectory;
     51
     52      CompletorFileSystem(const std::string& fileExtension = "",
     53                          StartDirectory startDir = StartAtDataDir,
     54                          const std::string& subDir = "");
     55      virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin);
     56
     57    private:
     58      std::string             _fileExtension;
     59      std::string             _subDir;
     60      StartDirectory          _startDir;
     61
    3562  };
    3663
    3764
    3865  //! A Templated Completor
    39   template<typename CLASS> class ShellCompletorTList : public ShellCompletor
     66  template<typename CLASS> class CompletorTList : public Completor
    4067  {
    41   public:
    42     ShellCompletorTList(const std::list<CLASS*>& completionList);
    43     virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
    44     {};
     68    public:
     69      CompletorTList(const std::list<CLASS*>& completionList);
     70      virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
     71      {};
    4572  };
    4673
    4774
     75
     76
     77
    4878  //! A class for Completing the an InputString.
    49   class ShellCompletionPlugin
     79  class CompletionPlugin
    5080  {
    51   public:
    52     ShellCompletionPlugin();
     81    private:
     82
     83    public:
     84      CompletionPlugin();
    5385
    5486
Note: See TracChangeset for help on using the changeset viewer.