20#include "../../kernel.hpp"
51 if (sStr.front() ==
'"')
90 if (i >= size() && size() > 1)
105 return _parser.
Eval();
120 if (i >= size() && size() > 1)
135 return _parser.
Eval() != 0.0;
148 std::vector<std::string>::assign(sVect.begin(), sVect.end());
163 for (
size_t i = 0; i < vect.size(); i++)
165 std::vector<std::string>::operator[](i) = vect[i] ?
"true" :
"false";
341 std::vector<std::string>::push_back(
"\"" + sStr +
"\"");
355 std::vector<std::string>::push_back(
"\"" + std::string(sStr) +
"\"");
369 std::vector<std::string>::push_back(
toString(vVal, 20));
383 std::vector<std::string>::push_back(
toString(nVal));
397 std::vector<std::string>::push_back(
toString(nVal));
411 std::vector<std::string>::push_back(
toString(nVal));
425 std::vector<std::string>::push_back(
toString(nVal));
457 return at(i).front() ==
'"';
458 else if (size() == 1)
459 return front().front() ==
'"';
478 size_t len = std::vector<std::string>::operator[](i).length();
479 std::vector<std::string>::operator[](i) =
"\"" + (len < minChars ? std::string(minChars-len,
'0') :
"") + std::vector<std::string>::operator[](i) +
"\"";
513 else if (size() == 1)
533 std::string sRet = at(i);
537 for (
size_t i = 1; i < sRet.length() - 1; i++)
540 if (sRet[i] ==
'\\' && sRet[i + 1] !=
'"' && sRet[i + 1] !=
' ')
542 sRet.insert(i + 1,
" ");
547 if (sRet[i] ==
'"' && sRet[i - 1] !=
'\\' && sRet[i + 1] !=
NEWSTRING && sRet.find(
'"', i + 1) != std::string::npos)
549 sRet.insert(i,
"\\");
557 if (sRet[i + 1] ==
'"')
582 return std::vector<std::string>::operator[](i);
584 throw std::out_of_range(
"Requested element " +
toString(i) +
", which is greater than this->size().");
597 std::vector<bool> vRet(
std::max(size(), sVect.size()));
599 for (
size_t i = 0; i < vRet.size(); i++)
622 std::vector<bool> vRet(
std::max(size(), sVect.size()));
624 for (
size_t i = 0; i < vRet.size(); i++)
647 std::vector<bool> vRet(
std::max(size(), sVect.size()));
649 for (
size_t i = 0; i < vRet.size(); i++)
672 std::vector<bool> vRet(
std::max(size(), sVect.size()));
674 for (
size_t i = 0; i < vRet.size(); i++)
697 std::vector<bool> vRet(
std::max(size(), sVect.size()));
699 for (
size_t i = 0; i < vRet.size(); i++)
722 std::vector<bool> vRet(
std::max(size(), sVect.size()));
724 for (
size_t i = 0; i < vRet.size(); i++)
748 std::vector<bool> vRet(
std::max(size(), sVect.size()));
750 for (
size_t i = 0; i < vRet.size(); i++)
769 std::vector<bool> vRet(
std::max(size(), sVect.size()));
771 for (
size_t i = 0; i < vRet.size(); i++)
790 std::vector<bool> vRet(
std::max(size(), sVect.size()));
792 for (
size_t i = 0; i < vRet.size(); i++)
812 for (
size_t i = 0; i < vRet.size(); i++)
880 if (sLogicals.size() == 1)
892 for (
size_t i = 0; i < vRet.size(); i++)
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
Simply container to provide the data for a StringView instance usable by all the string functions.
std::string & getRef()
Get a reference to the contained string.
This class is an extension to the std::vector<std::string> to provide the vector-like functionalities...
StringVector & operator=(const StringVector &sVect)
Assignment operator overload for a StringVector instance.
StringView operator[](size_t i) const
Return a view to the i-th element.
void push_back(const std::string &sStr)
Append a string to the end of this vector. Will be stored as local string.
std::string & getRef(size_t i)
Return a reference to the i-th element in this string.
std::vector< bool > operator!=(const StringVector &sVect) const
Inequality operator overload.
std::string getMasked(size_t i) const
Return the contained string with the internal quotation marks as escaped variants.
std::vector< bool > operator<(const StringVector &sVect) const
Less-than operator overload.
StringVector()
Default constructor.
std::vector< bool > operator==(const StringVector &sVect) const
Equality operator overload.
void convert_to_string(size_t i, size_t minChars=0)
Convert the i-th element to a string.
const std::string m_sDUMMY
static StringVector convert_internal(const std::string &sInternal)
Static member function to create a StringVector instance from an internal string.
static StringVector empty_string()
Static member function to create a StringVector with one component with zero length.
void push_generic(const std::string &sStr)
Append a generic string value to the end of this vector. Depending on the existence of surrounding qu...
mu::value_type getNumericalVectorized(size_t i) const
Get either the i-th element or the 1st element converted as numerical value, if this vector has only ...
std::vector< bool > xor_f(const StringVector &sVect) const
This member function represents an XOR operator.
std::vector< bool > operator>=(const StringVector &sVect) const
Greater-equal operator overload.
bool is_string(size_t i) const
Check whether the i-th element represents a string or a numeric value.
static StringView makePureString(StringView sStr)
Static member function to convert the contained string into a pur C++ string.
std::vector< bool > operator<=(const StringVector &sVect) const
Lesser-equal operator overload.
std::vector< bool > or_f(const StringVector &sVect) const
This member function represents an OR operator.
StringVector & operator+=(const std::string &sLiteral)
Append a string literal to this StringVector instance.
StringVector operator+(const std::string &sLiteral) const
Concatenate a StringVector and a string literal.
std::vector< bool > and_f(const StringVector &sVect) const
This member function represents an AND operator.
std::vector< bool > operator>(const StringVector &sVect) const
Greater-than operator overload.
StringVector & evalIfElse(const StringVector &sLogicals, const StringVector &sIfBranch, const StringVector &sElseBranch)
Assign the results of an if-else construct to this StringVector instance.
bool getBooleanVectorized(size_t i) const
Get either the i-th element or the 1st element converted as boolean, if this vector has only one comp...
StringView getVectorized(size_t i) const
Get either the i-th element or the 1st element, if this vector has only one component (and is a singl...
StringArg getArg(size_t i) const
Create a StringArg instance from the i-th or the 1st element, if this vector is a singleton.
void assign(const StringVector &sVect)
Assign another StringVector instance.
static StringVector convert_literal(const std::string &sLiteral)
Static member function to create a StringVector instance from a string literal.
static std::string makeLocalString(const std::string &sStr)
Static member function to convert the string literal to an internal string for this class.
const char & front() const
This member function provides a const char reference to the first character in the viewed section.
std::string to_string() const
This member function returns a copy of the viewed section of the string (via std::string::substr)....
size_t length() const
This member function simply returns the length of the viewed section.
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
StringView subview(size_t pos=0, size_t len=std::string::npos) const
This member function creates a new StringView class instance using the selected position and length a...
void SetExpr(StringView a_sExpr)
Set the expression. Triggers first time calculation thus the creation of the bytecode and scanning of...
value_type Eval()
Single-value wrapper around the vectorized overload of this member function.
Mathematical expressions parser.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
std::string toString(int)
Converts an integer to a string without the Settings bloat.