31#include "../ui/error.hpp"
32#include "../io/filesystem.hpp"
33#include "../settings.hpp"
34#include "../utils/tools.hpp"
54 std::string
parse(
const std::string& _sArgList);
85 std::map<std::string, FunctionDefinition>::const_iterator
findItemById(
size_t id)
const;
95 bool defineFunc(
const std::string& sExpr,
bool bRedefine =
false,
bool bFallback =
false);
101 bool call(std::string& sExpr,
int nRecursion = 0);
118 bool load(
const Settings& _option,
bool bAutoLoad =
false);
129 std::string sReturn =
";";
133 sReturn += iter->first +
";";
188 if (iter->first == sFuncName.substr(0, sFuncName.find(
'(')))
This class implements the basic input/ output file system and provides functionalities to work with f...
This class implements a single function definition. It is managed by the Define class.
bool splitAndValidateArguments()
This private member function validates the arguments of the function definition.
std::vector< std::string > vArguments
FunctionDefinition(const std::string &_sDefinitionString="")
Constructor of the FunctionDefinition class. Creates a definition from the passed definition string.
bool convertToValues()
This private member function converts the selected of the passed variables into their values.
std::string getDefinition() const
This member function returns the definition of the function without the appended parameters.
bool appendComment(const std::string &_sComment)
This member function appends a comment, which might be set after the definition.
std::string sDefinitionString
FunctionDefinition & operator=(const FunctionDefinition &)
Assignment operator overload for the Function definition class.
bool importFunction(const std::string &_sExportedString)
This member function imports a previously exported definition string and distributes its contents alo...
std::string parse(const std::string &_sArgList)
This member function parses the call to the contained function definition and returns a function defi...
bool decodeDefinition()
This private member function decodes the definition in the private member variable "sDefinitionString...
bool replaceArgumentOccurences()
This private member function replaces all occurences of the passed arguments with the corresponding n...
std::string exportFunction() const
This member function creates the save string used for writing to the definition file.
std::string sParsedDefinitionString
This class implements the function definition managing instance.
std::string getFunctionSignature(size_t _i) const
Returns the function signature of the ith defined custom function.
void setTableList(const std::string &sTableList)
Sets the internal table list. This list is used to avoid redefinition of an already existing table as...
bool reset()
This member function resets the FunctionDefinitionManager object to a state before any function was d...
std::string getDefinitionString(size_t _i) const
Returns the definition string of the ith defined custom function.
bool defineFunc(const std::string &sExpr, bool bRedefine=false, bool bFallback=false)
This function defines a custom function, by passing it to a new FunctionDefinition class instance.
void setPredefinedFuncs(const std::string &sPredefined)
This member function updates the internal list of predefined functions. If the list is whitespace-sep...
bool undefineFunc(const std::string &sFunc)
This function removes a previously defined function from the internal memory.
std::string getPredefinedFuncs() const
Return a list of the internal defined default functions.
std::string getComment(size_t _i) const
Returns the comment of the ith defined function.
std::string resolveRecursiveDefinitions(std::string sDefinition)
This private member function resolves recursive definitions, which are handled by replacing the occur...
bool call(std::string &sExpr, int nRecursion=0)
This function searches for known custom definitions in the passed expression and replaces them with t...
std::map< std::string, FunctionDefinition >::const_iterator findItemById(size_t id) const
This private member function returns the iterator to the function pointed by the passed ID.
bool isDefined(const std::string &sFunc)
This method checks, whether the passed function is already defined.
size_t getFunctionIndex(const std::string &sFuncName)
Returns the numerical index of the selected custom defined functions.
FunctionDefinitionManager(bool _isLocal)
Default constructor of the FunctionDefinitionManager class. Prepares the list of protected command st...
bool load(const Settings &_option, bool bAutoLoad=false)
This function loads previously saved function definitions to memory.
std::map< std::string, FunctionDefinition > mFunctionsMap
bool save(const Settings &_option)
This function saves the function definitions to the definition file.
std::string getNamesOfDefinedFunctions() const
Returns a list of the names of the custom defined functions.
std::string getImplementation(size_t _i) const
Returns the implementation of the ith defined custom function.
size_t getDefinedFunctions() const
Returns the number of defined functions.
This class manages the setting values of the internal (kernel) settings of this application.