NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class is a base class for all string view classes. More...
#include <structures.hpp>
Public Member Functions | |
StringViewBase () | |
StringViewBase default constructor. More... | |
virtual const std::string * | getData () const |
This member function returns a const pointer to the viewed string. Is only used internally. More... | |
bool | operator== (const StringViewBase &view) const |
This member function is an overload for the equality operator using another StringViewBase instance. More... | |
bool | operator== (const std::string &sString) const |
This member function is an overload for the equality operator using a const std::string instance. More... | |
bool | operator== (const char *sString) const |
This member function is an overload for the equality operator using a const char*. More... | |
bool | operator!= (const StringViewBase &view) const |
This member function is an overload for the inequality operator using another StringViewBase instance. More... | |
bool | operator!= (const std::string &sString) const |
This member function is an overload for the inequality operator using a const std::string instance. More... | |
bool | operator!= (const char *sString) const |
This member function is an overload for the inequality operator using a const char*. More... | |
bool | operator< (const StringViewBase &view) const |
This member function is an overload for the less operator using another StringViewBase instance. More... | |
bool | operator< (const std::string &sString) const |
This member function is an overload for the less operator using a const std::string instance. More... | |
bool | operator<= (const StringViewBase &view) const |
This member function is an overload for the less-equal operator using another StringViewBase instance. More... | |
bool | operator<= (const std::string &sString) const |
This member function is an overload for the less-equal operator using a const std::string instance. More... | |
bool | operator> (const StringViewBase &view) const |
This member function is an overload for the greater operator using another StringViewBase instance. More... | |
bool | operator> (const std::string &sString) const |
This member function is an overload for the greater operator using a const std::string instance. More... | |
bool | operator>= (const StringViewBase &view) const |
This member function is an overload for the greater-equal operator using another StringViewBase instance. More... | |
bool | operator>= (const std::string &sString) const |
This member function is an overload for the greater-equal operator using a const std::string instance. More... | |
std::string | operator+ (const StringViewBase &view) const |
This member function is an overload for the concatenation operator using another StringViewBase instance. More... | |
std::string | operator+ (const std::string &sString) const |
This member function is an overload for the concatenation operator using a const std::string instance. More... | |
const char & | front () const |
This member function provides a const char reference to the first character in the viewed section. More... | |
const char & | back () const |
This member function provides a const char reference to the last character in the viewed section. More... | |
std::string::const_iterator | begin () const |
This member function provides an iterator to the beginning of the viewed section of the internal string. More... | |
std::string::const_iterator | end () const |
This member function provides an iterator to the end of the viewed section of the internal string. More... | |
void | trim_front (size_t len) |
This member function can be used to remove characters from the front of the viewed section. More... | |
void | trim_back (size_t len) |
This member function can be used to remove characters from the back of the viewed section. More... | |
void | strip () |
This member function shrinks the viewed section to remove all leading or trailing whitespace characters. This is the corresponding member function to StripSpaces(std::string&). More... | |
size_t | length () const |
This member function simply returns the length of the viewed section. More... | |
std::string | to_string () const |
This member function returns a copy of the viewed section of the string (via std::string::substr). Note that this is an inefficient operation. More... | |
size_t | find (const std::string &findstr, size_t pos=0) const |
Wrapper member function for std::string::find() More... | |
size_t | find (char c, size_t pos=0) const |
Wrapper member function for std::string::find() More... | |
size_t | rfind (const std::string &findstr, size_t pos=std::string::npos) const |
Wrapper member function for std::string::rfind() More... | |
size_t | rfind (char c, size_t pos=std::string::npos) const |
Wrapper member function for std::string::rfind() More... | |
size_t | find_first_of (const std::string &findstr, size_t pos=0) const |
Wrapper member function for std::string::find_first_of() More... | |
size_t | find_first_of (char c, size_t pos=0) const |
Wrapper member function for std::string::find_first_of() More... | |
size_t | find_first_not_of (const std::string &findstr, size_t pos=0) const |
Wrapper member function for std::string::find_first_not_of() More... | |
size_t | find_first_not_of (char c, size_t pos=0) const |
Wrapper member function for std::string::find_first_not_of() More... | |
size_t | find_last_of (const std::string &findstr, size_t pos=std::string::npos) const |
Wrapper member function for std::string::find_last_of() More... | |
size_t | find_last_of (char c, size_t pos=std::string::npos) const |
Wrapper member function for std::string::find_last_of() More... | |
size_t | find_last_not_of (const std::string &findstr, size_t pos=std::string::npos) const |
Wrapper member function for std::string::find_last_not_of() More... | |
size_t | find_last_not_of (char c, size_t pos=std::string::npos) const |
Wrapper member function for std::string::find_last_not_of() More... | |
Protected Member Functions | |
size_t | validizeLength (size_t pos, size_t len) const |
This private member function evaluates, whether the passed length is part of the viewed section and adapts the length correspondingly. More... | |
virtual void | clear () |
Reset function. More... | |
bool | validAbsolutePosition (size_t pos) const |
This member function checks, whether the passed (absolute) position is part of the viewed string section. Is mostly used in string find operations. More... | |
Protected Attributes | |
size_t | m_start |
size_t | m_len |
This class is a base class for all string view classes.
It gathers the common const operations like finding and equality operators. It can be instantated directly, but it will do nothing due to a missing pointer to the viewed std::string.
Definition at line 909 of file structures.hpp.
|
inline |
StringViewBase default constructor.
Definition at line 966 of file structures.hpp.
|
inline |
This member function provides a const char reference to the last character in the viewed section.
Definition at line 1282 of file structures.hpp.
References getData(), m_len, and m_start.
Referenced by mu::ParserBase::checkDelimiter(), NumeRe::StringLogicParser::concatenateStrings(), and extractIndexList().
|
inline |
This member function provides an iterator to the beginning of the viewed section of the internal string.
Definition at line 1298 of file structures.hpp.
References getData(), and m_start.
Referenced by getIndices(), and operator+().
|
inlineprotectedvirtual |
Reset function.
Reimplemented in MutableStringView, and StringView.
Definition at line 940 of file structures.hpp.
References m_len, and m_start.
Referenced by strip(), trim_back(), and trim_front().
|
inline |
This member function provides an iterator to the end of the viewed section of the internal string.
Definition at line 1314 of file structures.hpp.
References getData(), m_len, and m_start.
Referenced by getIndices(), and operator+().
|
inline |
Wrapper member function for std::string::find()
c | char |
pos | size_t |
Definition at line 1456 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
|
inline |
Wrapper member function for std::string::find()
findstr | const std::string& |
pos | size_t |
Definition at line 1434 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
Referenced by FlowCtrl::calc(), mu::ParserBase::compileVectors(), mu::ParserBase::ContainsVectorVars(), findAssignmentOperator(), findCommand(), findCommandWithReturnValue(), NumeRe::StringFuncHandler::findNextFunction(), findShortestMatchForCommand(), NumeRe::ClusterManager::getCluster(), NumeRe::ClusterManager::isCluster(), isCompleteCluster(), isCompleteTable(), strfnc_findfile(), strfnc_findtoken(), strfnc_locate(), strfnc_strfnd(), strfnc_strfndall(), strfnc_strmatchall(), strfnc_textparse(), and NumeRe::ClusterManager::updateClusterSizeVariables().
|
inline |
Wrapper member function for std::string::find_first_not_of()
c | char |
pos | size_t |
Definition at line 1590 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
|
inline |
Wrapper member function for std::string::find_first_not_of()
findstr | const std::string& |
pos | size_t |
Definition at line 1568 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
Referenced by mu::ParserBase::compileVectors(), findCasualCommand(), strfnc_locate(), strfnc_str_not_match(), and strfnc_textparse().
|
inline |
Wrapper member function for std::string::find_first_of()
c | char |
pos | size_t |
Definition at line 1546 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
|
inline |
Wrapper member function for std::string::find_first_of()
findstr | const std::string& |
pos | size_t |
Definition at line 1524 of file structures.hpp.
References getData(), m_start, and validAbsolutePosition().
Referenced by expandIndexVectors(), getIndices(), getMatchingParenthesis(), mu::ParserBase::SetExpr(), strfnc_locate(), and strfnc_strmatch().
|
inline |
Wrapper member function for std::string::find_last_not_of()
c | char |
pos | size_t |
Definition at line 1681 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
|
inline |
Wrapper member function for std::string::find_last_not_of()
findstr | const std::string& |
pos | size_t |
Definition at line 1658 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
Referenced by strfnc_locate(), and strfnc_str_not_rmatch().
|
inline |
Wrapper member function for std::string::find_last_of()
c | char |
pos | size_t |
Definition at line 1635 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
|
inline |
Wrapper member function for std::string::find_last_of()
findstr | const std::string& |
pos | size_t |
Definition at line 1612 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
Referenced by mu::ParserBase::FindMultiArgFunc(), and strfnc_strrmatch().
|
inline |
This member function provides a const char reference to the first character in the viewed section.
Definition at line 1266 of file structures.hpp.
References getData(), and m_start.
Referenced by mu::ParserBase::checkDelimiter(), NumeRe::StringLogicParser::concatenateStrings(), StringVector::makePureString(), and strfnc_textparse().
|
inlinevirtual |
This member function returns a const pointer to the viewed string. Is only used internally.
Reimplemented in MutableStringView, and StringView.
Definition at line 976 of file structures.hpp.
Referenced by back(), begin(), end(), find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), front(), operator!=(), operator+(), operator<(), operator<=(), operator==(), operator>(), operator>=(), rfind(), strip(), and to_string().
|
inline |
This member function simply returns the length of the viewed section.
Definition at line 1403 of file structures.hpp.
References m_len.
Referenced by NumeRe::StringFuncHandler::argumentParser(), FlowCtrl::calc(), mu::ParserBase::compileVectorExpansion(), mu::ParserBase::compileVectors(), mu::ParserBase::compileVectorsInMultiArgFunc(), NumeRe::StringLogicParser::concatenateStrings(), convertBaseToDecimal(), mu::ExpressionTarget::create(), NumeRe::StringParser::createStack(), DataAccessParser::DataAccessParser(), expandIndexVectors(), extractIndexList(), findCasualCommand(), findCommandWithReturnValue(), NumeRe::StringFuncHandler::findNextFunction(), findShortestMatchForCommand(), getAllArguments(), StringVector::getBooleanVectorized(), getIndices(), getMatchingParenthesis(), getNextCommandLineToken(), handleIndexVectors(), isInQuotes(), StringVector::makePureString(), strfnc_ascii(), strfnc_findfile(), strfnc_findparam(), strfnc_findtoken(), strfnc_getenvvar(), strfnc_getFileParts(), strfnc_isalnum(), strfnc_isalpha(), strfnc_isblank(), strfnc_iscntrl(), strfnc_isdigit(), strfnc_isgraph(), strfnc_islower(), strfnc_isprint(), strfnc_ispunct(), strfnc_isspace(), strfnc_isupper(), strfnc_isxdigit(), strfnc_justify(), strfnc_locate(), strfnc_regex(), strfnc_replace(), strfnc_str_not_match(), strfnc_str_not_rmatch(), strfnc_strfnd(), strfnc_strfndall(), strfnc_strip(), strfnc_strlen(), strfnc_strmatch(), strfnc_strmatchall(), strfnc_strrfnd(), strfnc_strrmatch(), strfnc_substr(), strfnc_textparse(), strfnc_timeformat(), strfnc_to_string(), and strfnc_to_time().
|
inline |
This member function is an overload for the inequality operator using a const char*.
sString | const char* |
Definition at line 1080 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the inequality operator using a const std::string instance.
sString | const std::string& |
Definition at line 1063 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the inequality operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1046 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the concatenation operator using a const std::string instance.
view | const StringViewBase& |
Definition at line 1250 of file structures.hpp.
References begin(), end(), and getData().
|
inline |
This member function is an overload for the concatenation operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1233 of file structures.hpp.
References begin(), end(), and getData().
|
inline |
This member function is an overload for the less operator using a const std::string instance.
sString | const std::string& |
Definition at line 1114 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the less operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1097 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the less-equal operator using a const std::string instance.
sString | const std::string& |
Definition at line 1148 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the less-equal operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1131 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the equality operator using a const char*.
sString | const char* |
Definition at line 1027 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the equality operator using a const std::string instance.
sString | const std::string& |
Definition at line 1009 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the equality operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 990 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the greater operator using a const std::string instance.
sString | const std::string& |
Definition at line 1182 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the greater operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1165 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the greater-equal operator using a const std::string instance.
sString | const std::string& |
Definition at line 1216 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
This member function is an overload for the greater-equal operator using another StringViewBase instance.
view | const StringViewBase& |
Definition at line 1199 of file structures.hpp.
References getData(), m_len, and m_start.
|
inline |
Wrapper member function for std::string::rfind()
c | char |
pos | size_t |
Definition at line 1501 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
|
inline |
Wrapper member function for std::string::rfind()
findstr | const std::string& |
pos | size_t |
Definition at line 1478 of file structures.hpp.
References getData(), m_start, validAbsolutePosition(), and validizeLength().
Referenced by isInQuotes(), strfnc_findfile(), and strfnc_strrfnd().
|
inline |
This member function shrinks the viewed section to remove all leading or trailing whitespace characters. This is the corresponding member function to StripSpaces(std::string&).
Definition at line 1369 of file structures.hpp.
References clear(), getData(), m_len, and m_start.
Referenced by FlowCtrl::calc(), NumeRe::StringLogicParser::concatenateStrings(), NumeRe::StringParser::createStack(), expandIndexVectors(), extractIndexList(), getIndices(), getNextCommandLineToken(), mu::ParserBase::IsAlreadyParsed(), isEqualStripped(), strfnc_getkeyval(), strfnc_justify(), and strfnc_locate().
|
inline |
This member function returns a copy of the viewed section of the string (via std::string::substr). Note that this is an inefficient operation.
Definition at line 1417 of file structures.hpp.
References getData(), m_len, and m_start.
Referenced by NumeRe::StringFuncHandler::applySpecialStringFuncs(), NumeRe::StringFuncHandler::argumentParser(), FlowCtrl::calc(), mu::ParserBase::compileVectorExpansion(), NumeRe::StringLogicParser::concatenateStrings(), convertBaseToDecimal(), DataAccessParser::DataAccessParser(), NumeRe::StringFuncHandler::evalFunction(), expandIndexVectors(), findCasualCommand(), findCommand(), findCommandWithReturnValue(), mu::ParserBase::FindMultiArgFunc(), NumeRe::StringFuncHandler::findNextFunction(), findShortestMatchForCommand(), getAccessParserForPlotAndFit(), NumeRe::ClusterManager::getCluster(), getNextArgument(), getNextIndex(), getNextSemiColonSeparatedToken(), handleCasualIndices(), isCompleteTable(), MemoryManager::mapStringViewFind(), operator+(), StringVector::operator+(), MutableStringView::replace(), mu::ParserBase::SetExpr(), strfnc_basetodec(), strfnc_char(), strfnc_findfile(), strfnc_findparam(), strfnc_findtoken(), strfnc_getenvvar(), strfnc_getfileinfo(), strfnc_getfilelist(), strfnc_getFileParts(), strfnc_getfolderlist(), strfnc_getkeyval(), strfnc_getopt(), strfnc_isdir(), strfnc_isfile(), strfnc_justify(), strfnc_locate(), strfnc_max(), strfnc_min(), strfnc_regex(), strfnc_repeat(), strfnc_replace(), strfnc_replaceall(), strfnc_sha256(), strfnc_split(), strfnc_str_not_match(), strfnc_str_not_rmatch(), strfnc_strfnd(), strfnc_strfndall(), strfnc_strip(), strfnc_strmatch(), strfnc_strrfnd(), strfnc_strrmatch(), strfnc_substr(), strfnc_textparse(), strfnc_timeformat(), strfnc_to_lowercase(), strfnc_to_time(), and strfnc_to_uppercase().
|
inline |
This member function can be used to remove characters from the back of the viewed section.
len | size_t |
Definition at line 1351 of file structures.hpp.
References clear(), and m_len.
Referenced by strfnc_strip().
|
inline |
This member function can be used to remove characters from the front of the viewed section.
len | size_t |
Definition at line 1331 of file structures.hpp.
References clear(), m_len, and m_start.
Referenced by NumeRe::StringParser::createStack(), getIndices(), getNextCommandLineToken(), and strfnc_strip().
|
inlineprotected |
This member function checks, whether the passed (absolute) position is part of the viewed string section. Is mostly used in string find operations.
pos | size_t |
Definition at line 956 of file structures.hpp.
References m_len, and m_start.
Referenced by find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), and rfind().
|
inlineprotected |
This private member function evaluates, whether the passed length is part of the viewed section and adapts the length correspondingly.
pos | size_t starting position |
len | size_t |
Definition at line 926 of file structures.hpp.
References m_len.
Referenced by find_last_not_of(), find_last_of(), MutableStringView::replace(), rfind(), StringView::StringView(), MutableStringView::subview(), and StringView::subview().
|
protected |
Definition at line 913 of file structures.hpp.
Referenced by StringView::assign(), MutableStringView::assign(), back(), clear(), MutableStringView::clear(), StringView::clear(), end(), length(), StringView::make_mutable(), MutableStringView::MutableStringView(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), MutableStringView::replace(), StringView::StringView(), strip(), MutableStringView::subview(), StringView::subview(), to_string(), trim_back(), trim_front(), validAbsolutePosition(), and validizeLength().
|
protected |
Definition at line 912 of file structures.hpp.
Referenced by StringView::assign(), MutableStringView::assign(), back(), begin(), clear(), MutableStringView::clear(), StringView::clear(), end(), find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), front(), StringView::make_mutable(), MutableStringView::MutableStringView(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), MutableStringView::operator[](), StringView::operator[](), MutableStringView::replace(), rfind(), StringView::StringView(), strip(), MutableStringView::subview(), StringView::subview(), to_string(), trim_front(), and validAbsolutePosition().