Changeset 1430 for code/branches/console/src/core/ConsoleCommand.cc
- Timestamp:
- May 26, 2008, 8:30:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/ConsoleCommand.cc
r1416 r1430 34 34 { 35 35 this->accessLevel_ = AccessLevel::None; 36 this->a utocompletionFunction_[0] = &autocompletion::fallback;37 this->a utocompletionFunction_[1] = &autocompletion::fallback;38 this->a utocompletionFunction_[2] = &autocompletion::fallback;39 this->a utocompletionFunction_[3] = &autocompletion::fallback;40 this->a utocompletionFunction_[4] = &autocompletion::fallback;36 this->argumentCompleter_[0] = 0; 37 this->argumentCompleter_[1] = 0; 38 this->argumentCompleter_[2] = 0; 39 this->argumentCompleter_[3] = 0; 40 this->argumentCompleter_[4] = 0; 41 41 } 42 42 43 ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, std::list<std::pair<std::string, std::string> > (*function) (void))43 ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, ArgumentCompleter* completer) 44 44 { 45 45 if (param < 5) 46 this->a utocompletionFunction_[param] = function;46 this->argumentCompleter_[param] = completer; 47 47 else 48 48 { … … 52 52 } 53 53 54 const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param)54 void ConsoleCommand::createArgumentCompletionList(unsigned int param, const std::string& param1, const std::string& param2, const std::string& param3, const std::string& param4, const std::string& param5) 55 55 { 56 if (param < 5 )57 this->argumentList_ = (*this->a utocompletionFunction_[param])();56 if (param < 5 && this->argumentCompleter_[param]) 57 this->argumentList_ = (*this->argumentCompleter_[param])(param1, param2, param3, param4, param5); 58 58 else 59 this->argumentList_ = autocompletion::fallback(); 60 61 return this->argumentList_; 62 } 63 64 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param) 65 { 66 if (param < 5) 67 this->argumentList_ = (*this->autocompletionFunction_[param])(); 68 else 69 this->argumentList_ = autocompletion::fallback(); 70 71 return this->argumentList_.begin(); 72 } 73 74 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param) 75 { 76 if (param < 5) 77 this->argumentList_ = (*this->autocompletionFunction_[param])(); 78 else 79 this->argumentList_ = autocompletion::fallback(); 80 81 return this->argumentList_.end(); 59 this->argumentList_.clear(); 82 60 } 83 61 }
Note: See TracChangeset
for help on using the changeset viewer.