Changeset 1416 for code/branches/console/src/core/ConsoleCommand.cc
- Timestamp:
- May 25, 2008, 1:11:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/ConsoleCommand.cc
r1402 r1416 41 41 } 42 42 43 ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, const std::list<std::pair<std::string, std::string> >&(*function) (void))43 ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, std::list<std::pair<std::string, std::string> > (*function) (void)) 44 44 { 45 45 if (param < 5) … … 52 52 } 53 53 54 const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param) const54 const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param) 55 55 { 56 56 if (param < 5) 57 return(*this->autocompletionFunction_[param])();57 this->argumentList_ = (*this->autocompletionFunction_[param])(); 58 58 else 59 return autocompletion::fallback(); 59 this->argumentList_ = autocompletion::fallback(); 60 61 return this->argumentList_; 60 62 } 61 63 62 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param) const64 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param) 63 65 { 64 std::cout << "3_1: param: " << param << "\n";65 66 if (param < 5) 66 { 67 std::cout << "3_2: >" << this->autocompletionFunction_[param] << "<\n"; 68 return (*this->autocompletionFunction_[param])().begin(); 69 } 67 this->argumentList_ = (*this->autocompletionFunction_[param])(); 70 68 else 71 { 72 std::cout << "3_3\n"; 73 return autocompletion::fallback().begin(); 74 } 69 this->argumentList_ = autocompletion::fallback(); 70 71 return this->argumentList_.begin(); 75 72 } 76 73 77 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param) const74 std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param) 78 75 { 79 std::cout << "4_1: param: " << param << "\n";80 76 if (param < 5) 81 { 82 std::cout << "4_2: >" << this->autocompletionFunction_[param] << "<\n"; 83 return (*this->autocompletionFunction_[param])().end(); 84 } 77 this->argumentList_ = (*this->autocompletionFunction_[param])(); 85 78 else 86 { 87 std::cout << "4_3\n"; 88 return autocompletion::fallback().end(); 89 } 79 this->argumentList_ = autocompletion::fallback(); 80 81 return this->argumentList_.end(); 90 82 } 91 83 }
Note: See TracChangeset
for help on using the changeset viewer.