NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class handles all logical operations on string expressions. More...
#include <stringlogicparser.hpp>
Protected Member Functions | |
bool | detectStringLogicals (const std::string &sString) |
This member function is may detect logical expressions in the passed string expression. More... | |
std::string | evalStringLogic (std::string sLine, bool &bReturningLogicals) |
This member function will evaluate logical string expressions in the passed command line. More... | |
void | concatenateStrings (std::string &sExpr) |
This member function performs the actual string concatenation of the passed string expression. More... | |
Private Member Functions | |
std::string | evalStringTernary (std::string sLine) |
This member function will evaluate the ternary operator for strings. More... | |
std::vector< std::string > | getStringTernaryExpression (std::string &sLine, size_t &nPos) |
This member function is a helper for StringLogicParser::evalStringLogic(). More... | |
size_t | detectPathTokens (const std::string &sString, size_t nPos) |
This member function is a helper for StringLogicParser::detectStringLogicals(). More... | |
std::string | prepareComparisonValues (const std::string &_sLine) |
Removes masked strings, strips spaces and removes surrounding quotation marks and concatenates the values, if necessary. More... | |
This class handles all logical operations on string expressions.
Definition at line 31 of file stringlogicparser.hpp.
|
protected |
This member function performs the actual string concatenation of the passed string expression.
sExpr | string& |
This member is called by StringParser::applyElementaryStringOperations() for the concatenation.
Definition at line 477 of file stringlogicparser.cpp.
References StringViewBase::back(), StringViewBase::front(), StringViewBase::length(), SyntaxError::STRING_ERROR, StringViewBase::strip(), StripSpaces(), StringView::subview(), and StringViewBase::to_string().
Referenced by NumeRe::StringParser::applyElementaryStringOperations(), and prepareComparisonValues().
|
private |
This member function is a helper for StringLogicParser::detectStringLogicals().
sString | const string& |
nPos | size_t |
This function will identify path tokens, which will start at the passed position.
Definition at line 94 of file stringlogicparser.cpp.
Referenced by detectStringLogicals().
|
protected |
This member function is may detect logical expressions in the passed string expression.
sString | const string& |
Definition at line 229 of file stringlogicparser.cpp.
References detectPathTokens().
Referenced by NumeRe::StringParser::applyElementaryStringOperations().
|
protected |
This member function will evaluate logical string expressions in the passed command line.
sLine | string |
bReturningLogicals | bool& |
Definition at line 288 of file stringlogicparser.cpp.
References mu::ParserBase::Eval(), evalStringLogic(), evalStringTernary(), NumeReKernel::getInstance(), getMatchingParenthesis(), NumeReKernel::getParser(), isInQuotes(), prepareComparisonValues(), mu::ParserBase::SetExpr(), StripSpaces(), and toString().
Referenced by NumeRe::StringParser::applyElementaryStringOperations(), evalStringLogic(), evalStringTernary(), and prepareComparisonValues().
|
private |
This member function will evaluate the ternary operator for strings.
sLine | string |
Definition at line 36 of file stringlogicparser.cpp.
References mu::ParserBase::Eval(), evalStringLogic(), NumeReKernel::getInstance(), NumeReKernel::getParser(), getStringTernaryExpression(), isInQuotes(), mu::ParserBase::SetExpr(), and StripSpaces().
Referenced by evalStringLogic().
|
private |
This member function is a helper for StringLogicParser::evalStringLogic().
sLine | string& |
nPos | size_t& |
It will return the expression parts of the current ternary at nPos
in the components of the returned vector. nPos
ist the position of the question mark.
Definition at line 163 of file stringlogicparser.cpp.
References getMatchingParenthesis(), and SyntaxError::INVALID_INDEX.
Referenced by evalStringTernary().
|
private |
Removes masked strings, strips spaces and removes surrounding quotation marks and concatenates the values, if necessary.
_sLine | const std::string& |
Definition at line 133 of file stringlogicparser.cpp.
References concatenateStrings(), evalStringLogic(), removeMaskedStrings(), and StripSpaces().
Referenced by evalStringLogic().