class
IFunctionRepresents an ArgScript function.
These functions can return bool, float or int values, and can receive any quantity of parameters. The parameters must be separated and processed inside the function.
Public functions
- auto GetFloat(LexerString& ppString, Lexer& lexer) -> float pure virtual
- Calls this function expecting a float value to be returned.
- auto GetInt(LexerString& ppString, Lexer& lexer) -> int pure virtual
- Calls this function expecting an int value to be returned.
- auto GetBool(LexerString& ppString, Lexer& lexer) -> bool virtual
- Calls this function expecting a bool value to be returned.
-
auto GetDescription(DescriptionMode mode = DescriptionMode::
Basic) const -> const char* virtual - Returns a basic or complete description of what this function does.
Function documentation
float ArgScript:: IFunction:: GetFloat(LexerString& ppString,
Lexer& lexer) pure virtual
Calls this function expecting a float value to be returned.
Parameters | |
---|---|
ppString | The eastl::string that contains the parameters, for example '(1.0, "Vista")'. |
lexer | The lexer that can be used for parsing the parameters. |
The received eastl::string contains the arguments with no processing, with the parenthesis included; the variables are replaced, however. Boolean functions might throw an exception here.
int ArgScript:: IFunction:: GetInt(LexerString& ppString,
Lexer& lexer) pure virtual
Calls this function expecting an int value to be returned.
Parameters | |
---|---|
ppString | The eastl::string that contains the parameters, for example '(1.0, "Vista")'. |
lexer | The lexer that can be used for parsing the parameters. |
The received eastl::string contains the arguments with no processing, with the parenthesis included; the variables are replaced, however. Boolean functions can use this function as well, returning 1 for true and 0 for false.
bool ArgScript:: IFunction:: GetBool(LexerString& ppString,
Lexer& lexer) virtual
Calls this function expecting a bool value to be returned.
Parameters | |
---|---|
ppString | The eastl::string that contains the parameters, for example '(1.0, "Vista")'. |
lexer | The lexer that can be used for parsing the parameters. |
The received eastl::string contains the arguments with no processing, with the parenthesis included; the variables are replaced, however.
const char* ArgScript:: IFunction:: GetDescription(DescriptionMode mode = DescriptionMode:: Basic) const virtual
Returns a basic or complete description of what this function does.
Parameters | |
---|---|
mode | Whether the basic or complete description must be returned, in the DescriptionMode enum. |
This usually includes information about how to use it, i.e. the arguments required.