Changeset 7377 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Apr 26, 2006, 11:32:57 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell.h
r7375 r7377 16 16 17 17 #define SHELL_DEFAULT_FONT "fonts/final_frontier.ttf" 18 #define SHELL_DEFAULT_TEXT_COLOR 1.0f, 0.0f, 0.0f, 1.0f18 #define SHELL_DEFAULT_TEXT_COLOR 0.0f, 1.0f, 0.0f, 1.0f 19 19 #define SHELL_DEFAULT_BACKGROUND_COLOR 0.0f, 0.0f, 0.0f, 1.0f 20 20 -
trunk/src/lib/shell/shell_completion_plugin.cc
r7374 r7377 29 29 30 30 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) 33 32 { 34 33 unsigned int inputLen = completionBegin.size(); … … 37 36 completionList.push_back(this->_stringArray[i]); 38 37 } 39 };40 38 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 13 13 namespace OrxShell 14 14 { 15 class ShellCompletor 15 //! The Base of All Completors 16 class Completor 16 17 { 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() { }; 20 21 21 protected:22 ShellCompletor();22 protected: 23 Completor(); 23 24 }; 24 25 25 class ShellCompletorStringArray : public ShellCompletor 26 //! Completor that completes static Arrays of Strings. 27 class CompletorStringArray : public Completor 26 28 { 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); 31 33 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 35 62 }; 36 63 37 64 38 65 //! A Templated Completor 39 template<typename CLASS> class ShellCompletorTList : public ShellCompletor66 template<typename CLASS> class CompletorTList : public Completor 40 67 { 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 {}; 45 72 }; 46 73 47 74 75 76 77 48 78 //! A class for Completing the an InputString. 49 class ShellCompletionPlugin79 class CompletionPlugin 50 80 { 51 public: 52 ShellCompletionPlugin(); 81 private: 82 83 public: 84 CompletionPlugin(); 53 85 54 86
Note: See TracChangeset
for help on using the changeset viewer.