46 #ifndef _CommandEvaluation_H__ 47 #define _CommandEvaluation_H__ 95 int evaluateArguments(
bool bPrintError =
false);
99 {
return (this->execCommand_ !=
nullptr); }
103 {
return this->execCommand_; }
105 void setEvaluatedArgument(
unsigned int index,
const MultiType& arg);
106 MultiType getEvaluatedArgument(
unsigned int index)
const;
116 {
return this->possibleArguments_; }
125 unsigned int getNumberOfArguments()
const;
129 void retrievePossibleArguments();
unsigned int hintArgumentsOffset_
The index of the first argument in tokens_ used to display hints and argument lists.
Definition: CommandEvaluation.h:144
bool isValid() const
Returns true if the command evaluation contains a valid command that can be executed.
Definition: CommandEvaluation.h:98
const ConsoleCommand * execCommand_
The command that will be executed (can be nullptr if the command is not valid)
Definition: CommandEvaluation.h:139
unsigned int execArgumentsOffset_
The index of the first argument in tokens_ used to execute the command.
Definition: CommandEvaluation.h:143
void error(const std::string &text)
Prints output with error level.
Definition: ConsoleCommandCompilation.cc:145
Definition of orxonox::Functor and its specialized subclasses, as well as the createFunctor() functio...
The ConsoleCommand class stores all information about a console command which can be executed by Comm...
Definition: ConsoleCommand.h:88
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
SubString tokens_
The single words of the command string, split into tokens.
Definition: CommandEvaluation.h:141
const ConsoleCommand * getConsoleCommand() const
Returns the console command that was evaluated by this object.
Definition: CommandEvaluation.h:102
void strip(std::string *str)
Removes all whitespaces from a string.
Definition: StringUtils.cc:55
This class is used to execute and evaluate command-strings.
Definition: CommandExecutor.h:109
const ArgumentCompletionList & getPossibleArguments() const
Returns a list of possible arguments for the given command.
Definition: CommandEvaluation.h:115
std::string string_
The original command string, entered by the user in the shell.
Definition: CommandEvaluation.h:142
bool bTriedToEvaluatedArguments_
True if an attempt was started to evaluate the arguments (but not necessarily successful) ...
Definition: CommandEvaluation.h:149
A helper class to split a string into several tokens.
ArgumentCompletionList possibleArguments_
List of possible arguments for the command in the current state.
Definition: CommandEvaluation.h:146
A class that splits a string into multiple tokens using different options.
Definition: SubString.h:101
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Declaration of the MultiType and some helper constructs.
ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION_MULTI() command(const std::string &fragment)
Returns a list of commands and groups and also supports auto-completion of the arguments of these com...
Definition: ArgumentCompletionFunctions.cc:178
CommandEvaluation is used to gather information about a command and to evaluate its arguments...
Definition: CommandEvaluation.h:80
unsigned int numberOfEvaluatedArguments_
The number of evaluated arguments (ranges from 0 to MAX_FUNCTOR_ARGUMENTS)
Definition: CommandEvaluation.h:150
#define _CoreExport
Definition: CorePrereqs.h:61
The MultiType can hold a value of many possible types and convert them to other types.
Definition: MultiType.h:130
static size_t getSize(const ArgumentCompletionList &list)
Returns the size of an argument completion list - empty ("") arguments are not counted.
Definition: CommandEvaluation.cc:428
size_t getPossibleArgumentsSize() const
Returns the number of possible arguments. Empty ("") arguments are not counted.
Definition: CommandEvaluation.h:119
const ConsoleCommand * hintCommand_
The command that is used to display hints and argument lists (can be different to execCommand_ in som...
Definition: CommandEvaluation.h:140
std::list< ArgumentCompletionListElement > ArgumentCompletionList
Definition: ArgumentCompletionListElement.h:49
const unsigned int MAX_FUNCTOR_ARGUMENTS
The maximum number of parameters of a function that is supported by Functor.
Definition: Functor.h:127
bool bEvaluatedArguments_
True if the arguments of the command have been evaluated (and stored in arguments_) ...
Definition: CommandEvaluation.h:148
bool bPossibleArgumentsRetrieved_
True if the list of possible arguments was already retrieved.
Definition: CommandEvaluation.h:145
Definition of ArgumentCompletionList, which is used in argument completion functions, and its element.