Changeset 7387 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Apr 26, 2006, 10:45:12 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_completion_plugin.cc
r7377 r7387 37 37 } 38 38 39 40 41 CompletorList::CompletorList(const std::list<std::string>* list) 42 { 43 this->_list = list; 44 } 45 46 void CompletorList::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) 47 { 48 unsigned int inputLen = completionBegin.size(); 49 std::list<std::string>::const_iterator it; 50 for (it = this->_list->begin(); it != this->_list->end(); ++it) 51 if (!nocaseCmp((*it), completionBegin, inputLen)) 52 completionList.push_back(*it); 53 } 54 55 56 39 57 CompletorFileSystem::CompletorFileSystem(const std::string& fileExtension, 40 58 StartDirectory startDir, … … 42 60 : _fileExtension(fileExtension), _startDir(startDir), _subDir(subDir) 43 61 { } 62 44 63 45 64 void CompletorFileSystem::addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) -
trunk/src/lib/shell/shell_completion_plugin.h
r7386 r7387 19 19 virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0; 20 20 virtual ~Completor() { }; 21 22 21 protected: 23 22 Completor(); 24 23 }; 24 25 26 25 27 26 28 //! Completor that completes static Arrays of Strings. … … 36 38 unsigned int _size; 37 39 }; 40 41 42 class CompletorList : public Completor 43 { 44 public: 45 CompletorList(const std::list<std::string>* list); 46 virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin); 47 private: 48 const std::list<std::string>* _list; 49 }; 50 51 38 52 39 53 //! Completor that completes FileSystem Entries. … … 60 74 StartDirectory _startDir; 61 75 }; 76 77 62 78 63 79
Note: See TracChangeset
for help on using the changeset viewer.