ArgumentCompletionList
TracNav
Development
- Overview
- SVN
Download...
- Contribute
Programming:
- Modules
Documentation
- Overview
Core
- Overview
- ArgumentCompleter
- ArgumentCompletionFunctions
- ArgumentCompletionList
- BaseObject
- ClassFactory
- ClassIdentifier
- ClassTreeMask
- Clock
- CommandEvaluation
- CommandExecutor
- CommandLine
- ConfigFileManager
- ConfigValueContainer
- ConfigValueIncludes
- ConsoleCommand
- CoreIncludes
- Executor
- Factory
- Functor
- GameStates
- Identifier
Input...
- IRC
- Iterator
- Language
- Level
- Loader?
- MetaObjectList
- Namespace?
- ObjectList
- ObjectListBase
- ObjectListIterator
- OrxonoxClass
- RootGameState?
- Script?
- Shell?
- SubclassIdentifier
- Super
- TclBind
- TclThreadManager?
- XMLPort
Network...
Orxonox...
Util...
- API Reference
HowTo...
- FAQ
- Styleguide
More...
Content Creation:
Description
An ArgumentCompletionList is used to display possible arguments when trying to complete a ConsoleCommand in the CommandExecutor by calling complete(). ArgumentCompletionLists are returned by a function stored in a ArgumentCompleter.
An ArgumentCompletionList is in fact just a std::list with elements that return three strings:
- getString(): The string that will be used to complete the command
- getComparable(): A string in lowercase used to compare the possible arguments with the already typed argument fragment
- getDisplay(): The string that should be displayed in the list (but this is just fake - the other two strings do the real work)
Usage
ArgumentCompletionList myList = function();
std::string fragment = "a";
for (ArgumentCompletionList::iterator it = myList.begin();
it != myList.end(); ++it)
{
if ((*it).getComparable() starts_with fragment)
{
std::cout << "Argument: " << (*it).getDisplay() << std::endl;
return (*it).getString();
}
}







