21#include "../../kernel.hpp"
22#include "../utils/filecheck.hpp"
23#include <boost/tokenizer.hpp>
28#define DEFAULT_NUM_ARG INT_MIN
30#define NEWSTRING (char)23
44 std::string sRet = sString;
48 for (
size_t i = 0; i < sRet.length(); i++)
50 if (sRet.compare(i, 2,
"\\\"") == 0)
53 if (sRet.compare(i, 2,
"\\t") == 0
54 && sRet.compare(i, 4,
"\\tau") != 0
55 && sRet.compare(i, 6,
"\\theta") != 0
56 && sRet.compare(i, 6,
"\\times") != 0)
57 sRet.replace(i, 2,
"\t");
59 if (sRet.compare(i, 2,
"\\n") == 0
60 && sRet.compare(i, 3,
"\\nu") != 0)
61 sRet.replace(i, 2,
"\n");
63 if (sRet.compare(i, 2,
"\\ ") == 0)
81 if (sString.find(
'"') == std::string::npos || sString.front() !=
'"' || sString.back() !=
'"')
84 return sString.substr(1, sString.length() - 2);
98 if (sString.front() ==
'"' && sString.back() ==
'"')
101 return "\"" + sString +
"\"";
137 return "\\cdot10^{" + (negative ?
"-"+sExp : sExp) +
"}";
156 std::string sNumber =
toString(number, precision);
160 while (sNumber.find(
'e') != std::string::npos)
163 size_t firstExp = sNumber.find(
'e');
164 size_t expBegin = sNumber.find_first_not_of(
'0', firstExp + 2);
165 size_t expEnd = sNumber.find_first_not_of(
"0123456789", expBegin);
168 sNumber.replace(firstExp, expEnd-firstExp,
169 createLaTeXExponent(sNumber.substr(expBegin, expEnd-expBegin), sNumber[firstExp+1] ==
'-'));
178 return "$" + sNumber +
"$";
199 return "\"" + sToChar +
"\"";
249 return "\"" + std::string(sVarValue) +
"\"";
270 for (
size_t i = 0; i < vFileParts.size(); i++)
293 for (
unsigned int i = 0; i < vFileList.size(); i++)
298 if (!sFileList.size())
321 for (
unsigned int i = 0; i < vFolderList.size(); i++)
326 if (!sFolderList.size())
374 for (
unsigned int i = 0; i < sView.
length(); i++)
397 for (
unsigned int i = 0; i < sView.
length(); i++)
399 if (isblank(sView[i])
400 && _umlauts.
lower.find(sView[i]) == std::string::npos
401 && _umlauts.
upper.find(sView[i]) == std::string::npos)
425 for (
unsigned int i = 0; i < sView.
length(); i++)
427 if (isalnum(sView[i])
428 || _umlauts.
lower.find(sView[i]) != std::string::npos
429 || _umlauts.
upper.find(sView[i]) != std::string::npos)
453 for (
unsigned int i = 0; i < sView.
length(); i++)
455 if (isalpha(sView[i])
456 || _umlauts.
lower.find(sView[i]) != std::string::npos
457 || _umlauts.
upper.find(sView[i]) != std::string::npos)
485 for (
unsigned int i = 0; i < sView.
length(); i++)
487 if (iscntrl(sView[i])
488 && _umlauts.
lower.find(sView[i]) == std::string::npos
489 && _umlauts.
upper.find(sView[i]) == std::string::npos)
516 for (
unsigned int i = 0; i < sView.
length(); i++)
518 if (isdigit(sView[i]))
584 for (
unsigned int i = 0; i < sView.
length(); i++)
586 if (isgraph(sView[i])
587 || _umlauts.
lower.find(sView[i]) != std::string::npos
588 || _umlauts.
upper.find(sView[i]) != std::string::npos)
615 for (
unsigned int i = 0; i < sView.
length(); i++)
621 if (islower(sView[i])
622 || _umlauts.
lower.find(sView[i]) != std::string::npos)
650 for (
unsigned int i = 0; i < sView.
length(); i++)
652 if (isprint(sView[i])
653 || _umlauts.
lower.find(sView[i]) != std::string::npos
654 || _umlauts.
upper.find(sView[i]) != std::string::npos)
683 for (
unsigned int i = 0; i < sView.
length(); i++)
685 if (ispunct(sView[i])
686 && _umlauts.
lower.find(sView[i]) == std::string::npos
687 && _umlauts.
upper.find(sView[i]) == std::string::npos)
716 for (
unsigned int i = 0; i < sView.
length(); i++)
718 if (isspace(sView[i])
719 && _umlauts.
lower.find(sView[i]) == std::string::npos
720 && _umlauts.
upper.find(sView[i]) == std::string::npos)
749 for (
unsigned int i = 0; i < sView.
length(); i++)
751 if (isupper(sView[i])
752 || _umlauts.
upper.find(sView[i]) != std::string::npos)
779 for (
unsigned int i = 0; i < sView.
length(); i++)
781 if (isxdigit(sView[i]))
805 std::string sToChar =
"";
807 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
809 sToChar += (char)(funcArgs.
nMultiArg[i]);
812 return "\"" + sToChar +
"\"";
829 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
849 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
871 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
908 if (sView1.
rfind(
'.') != std::string::npos)
912 if (sExtension.
find(
'*') != std::string::npos || sExtension.
find(
'?') != std::string::npos)
913 sExtension = std::string(
".dat");
943 boost::char_separator<char> cSep(sSep.c_str());
946 boost::tokenizer<boost::char_separator<char> > tok(sToSeparate, cSep);
948 for (boost::tokenizer<boost::char_separator<char> >::iterator iter = tok.begin(); iter != tok.end(); ++iter)
950 sSplittedString.
push_back(std::string(*iter));
953 return sSplittedString;
974 if (sTime.length() != sPattern.length())
979 timeStruct.
m_hours = std::chrono::hours::zero();
980 timeStruct.
m_minutes = std::chrono::minutes::zero();
981 timeStruct.
m_seconds = std::chrono::seconds::zero();
982 timeStruct.
m_millisecs = std::chrono::milliseconds::zero();
983 timeStruct.
m_microsecs = std::chrono::microseconds::zero();
985 char cCurrentChar = sPattern.front();
986 std::string sCurrentElement;
989 if (sPattern.find_first_of(
"MD") != std::string::npos)
995 for (
size_t i = 0; i < sPattern.length(); i++)
997 if (sPattern[i] != cCurrentChar)
999 switch (cCurrentChar)
1003 if (sCurrentElement.length() > 2)
1018 timeStruct.
m_hours = std::chrono::hours(
StrToInt(sCurrentElement) + (
tz.Bias +
tz.DayLightBias).count() / 60);
1027 sCurrentElement.append(3-sCurrentElement.size(),
'0');
1031 sCurrentElement.append(3-sCurrentElement.size(),
'0');
1036 cCurrentChar = sPattern[i];
1037 sCurrentElement.clear();
1040 sCurrentElement += sTime[i];
1095 size_t pos_start = funcArgs.
nArg1 - 1;
1096 size_t pos_last = funcArgs.
nArg2 - sStr.length();
1098 while (pos_start <= pos_last)
1100 pos_start = sView.
find(sStr, pos_start);
1102 if (pos_start <= pos_last)
1110 if (positions.size())
1117 if (!positions.size())
1147 size_t pos_start = funcArgs.
nArg1 - 1;
1148 size_t pos_last = funcArgs.
nArg2 - 1;
1150 for (
size_t i = 0; i < sStr.
length(); i++)
1152 size_t match = sView.
find(sStr[i], pos_start);
1154 if (match <= pos_last)
1160 if (!positions.size())
1328 if (funcArgs.
nArg1 < 1)
1334 if (funcArgs.
nArg2 < 0)
1335 funcArgs.
nArg2 = -1;
1351 std::string sReturn;
1354 for (
int i = 0; i < funcArgs.
nArg1; i++)
1357 return "\"" + sReturn +
"\"";
1371 std::string sPadded =
toString(nTime);
1372 sPadded.insert(0, nLength - sPadded.length(),
'0');
1395 char cCurrentChar = sFormattedTime.front();
1396 size_t currentElementStart = 0;
1398 for (
size_t i = 0; i < sFormattedTime.length(); i++)
1400 if (cCurrentChar != sFormattedTime[i])
1402 switch (cCurrentChar)
1406 if (i - currentElementStart > 2)
1407 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(
int(timeStruct.
m_ymd.
year()), i - currentElementStart));
1409 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(
int(timeStruct.
m_ymd.
year()) - 100 * (
int(timeStruct.
m_ymd.
year()) / 100), i - currentElementStart));
1412 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(
unsigned(timeStruct.
m_ymd.
month()), i - currentElementStart));
1415 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(
unsigned(timeStruct.
m_ymd.
day()), i - currentElementStart));
1421 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_hours.count(), i - currentElementStart));
1424 if (timeStruct.
m_hours.count() - (
tz.Bias +
tz.DayLightBias).count() / 60 < 0)
1425 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_hours.count() + 24 - (
tz.Bias +
tz.DayLightBias).count() / 60, i - currentElementStart));
1426 else if (timeStruct.
m_hours.count() - (
tz.Bias +
tz.DayLightBias).count() / 60 >= 24)
1427 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_hours.count() - 24 - (
tz.Bias +
tz.DayLightBias).count() / 60, i - currentElementStart));
1429 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_hours.count() - (
tz.Bias +
tz.DayLightBias).count() / 60, i - currentElementStart));
1432 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_minutes.count(), i - currentElementStart));
1435 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_seconds.count(), i - currentElementStart));
1438 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_millisecs.count(), i - currentElementStart));
1441 sFormattedTime.replace(currentElementStart, i - currentElementStart,
padWithZeros(timeStruct.
m_microsecs.count(), i - currentElementStart));
1445 currentElementStart = i;
1446 cCurrentChar = sFormattedTime[i];
1449 sFormattedTime.pop_back();
1450 return "\"" + sFormattedTime +
"\"";
1469 return to_string(day);
1471 std::vector<std::string> weekdays =
_lang.
getList(
"COMMON_WEEKDAY_*");
1473 if (weekdays.size() >= 7)
1474 return "\"" + weekdays[day-1] +
"\"";
1476 return "\"UNDEFINED\"";
1492 if (funcArgs.
nArg1 <= 1)
1493 return "\"" + sStr.substr(0, 1) +
"\"";
1495 if ((
size_t)funcArgs.
nArg1 >= sStr.length())
1496 return "\"" + sStr.substr(sStr.length() - 1) +
"\"";
1498 return "\"" + sStr.substr(funcArgs.
nArg1 - 1, 1) +
"\"";
1514 if (funcArgs.
nArg1 <= 1)
1517 if ((
size_t)funcArgs.
nArg1 > sStr.length())
1540 if (funcArgs.
nArg1 < 1)
1547 funcArgs.
nArg2 = -1;
1573 std::stringstream stream;
1574 long long int ret = 0;
1578 else if (base ==
OCT)
1580 else if (base ==
BIN)
1582 for (
int i = value.
length() - 1; i >= 0; i--)
1584 if (value[i] ==
'1')
1590 else if (base ==
LOG)
1617 if (sExpr.find(
'{') != std::string::npos)
1620 val = std::stod(sExpr.substr(sExpr.find(
'{')+1, sExpr.find(
'}')));
1621 sExpr.erase(0, sExpr.find(
'}')+1);
1626 val = std::stod(sExpr.substr(sExpr.find_first_not_of(
"^ "), 1));
1627 sExpr.erase(0, sExpr.find_first_not_of(
"^ ")+1);
1652 return "\"" + sView1.
to_string() +
"\"";
1655 if (funcArgs.
nArg1 < 1)
1662 funcArgs.
nArg2 = -1;
1670 size_t lastPosition = funcArgs.
nArg1 - 1;
1671 static std::string sIDENTIFIERCHARS =
"sfaLlthbo";
1676 if (sView2.
front() !=
'%' && sView1.
front() ==
' ')
1682 for (
size_t i = 0; i < sView2.
length(); i++)
1685 if (lastPosition > (
size_t)funcArgs.
nArg2)
1689 if (i+1 < sView2.
length() && sView2[i] ==
'%' && sIDENTIFIERCHARS.
find(sView2[i+1]) != std::string::npos)
1692 size_t pos = std::string::npos;
1694 for (
size_t j = i+2; j < sView2.
length(); j++)
1696 if (j+1 < sView2.
length() && sView2[j] ==
'%' && sIDENTIFIERCHARS.
find(sView2[j+1]) != std::string::npos)
1708 if (!sSearchPattern.length())
1709 pos = std::string::npos;
1711 pos = sView1.
find(sSearchPattern, lastPosition);
1715 if (pos > (
size_t)funcArgs.
nArg2 && (
size_t)funcArgs.
nArg2 < sView1.
length())
1719 if (sView2.
subview(i, 2) ==
"%s")
1721 else if (sView2.
subview(i, 2) ==
"%h")
1723 else if (sView2.
subview(i, 2) ==
"%o")
1725 else if (sView2.
subview(i, 2) ==
"%b")
1727 else if (sView2.
subview(i, 2) ==
"%l")
1729 else if (sView2.
subview(i, 2) ==
"%t")
1731 else if (sView2.
subview(i, 2) ==
"%f")
1733 std::string sFloatingPoint = sView1.
subview(lastPosition, pos - lastPosition).
to_string();
1735 if (sFloatingPoint.find(
'.') == std::string::npos)
1740 else if (sView2.
subview(i, 2) ==
"%L")
1742 std::string sLaTeXFormatted = sView1.
subview(lastPosition, pos - lastPosition).
to_string();
1745 if (sLaTeXFormatted.front() ==
'$' && sLaTeXFormatted.back() ==
'$')
1747 sLaTeXFormatted = sLaTeXFormatted.substr(1, sLaTeXFormatted.length()-2);
1754 replaceAll(sLaTeXFormatted,
"2\\pi",
"6.283185");
1755 replaceAll(sLaTeXFormatted,
"\\pi",
"3.1415926");
1756 replaceAll(sLaTeXFormatted,
"\\infty",
"inf");
1761 if (sLaTeXFormatted.find(
'^') != std::string::npos)
1766 size_t nOpPos = std::string::npos;
1769 while (sLaTeXFormatted.length())
1771 nOpPos = sLaTeXFormatted.find_first_of(
"*^");
1772 vVal =
StrToCmplx(sLaTeXFormatted.substr(0, nOpPos));
1774 if (sLaTeXFormatted[nOpPos] ==
'*')
1776 sLaTeXFormatted.erase(0, nOpPos+1);
1777 nOpPos = sLaTeXFormatted.find(
'^');
1779 sLaTeXFormatted.erase(0, nOpPos+1);
1784 sLaTeXFormatted.erase(0, nOpPos+1);
1788 if (sLaTeXFormatted.find_first_not_of(
" *") != std::string::npos
1789 && tolower(sLaTeXFormatted[sLaTeXFormatted.find_first_not_of(
" *")]) ==
'i')
1792 sLaTeXFormatted.erase(0, sLaTeXFormatted.find_first_of(
"iI")+1);
1797 if (sLaTeXFormatted.find_first_not_of(
' ') == std::string::npos)
1816 return sParsedStrings;
1840 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
1845 if (funcArgs.
nArg1 == 1)
1853 else if (funcArgs.
nArg1 == 2)
1860 else if (funcArgs.
nArg1 == 3)
1868 else if (funcArgs.
nArg1 == 4)
1874 else if (funcArgs.
nArg1 == 5)
1914 if (funcArgs.
nArg1 == 0)
1921 std::sort(vFuncArgs.begin(), vFuncArgs.end());
1922 auto iter = std::unique(vFuncArgs.begin(), vFuncArgs.end());
1925 for (
auto it = vFuncArgs.begin(); it != iter; ++it)
1933 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
1936 std::string sArg = funcArgs.
sMultiArg[i].to_string();
1939 std::sort(sArg.begin(), sArg.end());
1940 auto iter = std::unique(sArg.begin(), sArg.end());
1943 sUniqueStrings.
push_back(std::string(sArg.begin(), iter));
1947 return sUniqueStrings;
1975 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i+=2)
1989 if (!sValues.size())
2016 if (!sStr3.length())
2023 while ((nMatch = sView1.
find(sStr2, nMatch)) != std::string::npos)
2025 if ((!nMatch || sStr3.find(sView1[nMatch-1]) != std::string::npos)
2026 && (nMatch + sStr2.length() >= sView1.
length() || sStr3.find(sView1[nMatch+sStr2.length()]) != std::string::npos))
2052 if (!sStr1.length())
2055 if (funcArgs.
nArg1 < 1)
2058 if ((
size_t)funcArgs.
nArg1 > sStr1.length())
2059 funcArgs.
nArg1 = sStr1.length();
2062 funcArgs.
nArg2 = sStr1.length() + 1;
2064 if (!sStr2.length())
2065 return "\"" + sStr1 +
"\"";
2070 return "\"" + sStr1 +
"\"";
2111 return "\"" + sView1.
to_string() +
"\"";
2133 if (funcArgs.
nArg1 < 1)
2140 funcArgs.
nArg2 = -1;
2148 if (std::regex_search(sStr, match, expr))
2156 catch (std::regex_error& e)
2158 std::string message;
2162 case std::regex_constants::error_collate:
2165 case std::regex_constants::error_ctype:
2168 case std::regex_constants::error_escape:
2171 case std::regex_constants::error_backref:
2174 case std::regex_constants::error_brack:
2177 case std::regex_constants::error_paren:
2180 case std::regex_constants::error_brace:
2183 case std::regex_constants::error_badbrace:
2186 case std::regex_constants::error_range:
2189 case std::regex_constants::error_space:
2192 case std::regex_constants::error_badrepeat:
2195 case std::regex_constants::error_complexity:
2198 case std::regex_constants::error_stack:
2244 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
2273 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
2283 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
2290 if (logtoidx.size())
2312 idxtolog.resize(*iter,
"false");
2314 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
2321 if (idxtolog.size())
2343 for (
size_t i = 1; i < funcArgs.
sMultiArg.size(); i++)
2368 for (
size_t i = 1; i < funcArgs.
sMultiArg.size(); i++)
2390 std::string sRet =
"";
2392 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
2393 sRet += funcArgs.
sMultiArg[i].to_string();
2395 return "\"" + sRet +
"\"";
2401 for (
size_t i = 0; i < funcArgs.
nMultiArg.size(); i++)
2422 std::stringstream stream;
2424 if (sView1 ==
"hex")
2426 else if (sView1 ==
"oct")
2428 else if (sView1 ==
"bin")
2433 while ((1 << i) <= funcArgs.
nArg1)
2435 if (funcArgs.
nArg1 & (1 << i))
2446 return "\"" + ret +
"\"";
2449 stream.setf(std::ios::showbase);
2450 stream << funcArgs.
nArg1;
2454 return "\"" + ret +
"\"";
2470 std::stringstream stream;
2472 if (sView1 ==
"hex")
2474 else if (sView1 ==
"oct")
2476 else if (sView1 ==
"bin")
2499 funcArgs.
nArg1 = -1;
2502 size_t maxLength = 0;
2505 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
2513 if (sStr.
length() > maxLength)
2514 maxLength = sStr.
length();
2518 for (
size_t i = 0; i < funcArgs.
sMultiArg.size(); i++)
2525 if (funcArgs.
nArg1 == 1)
2526 sStr.insert(0, maxLength - sStr.size(),
' ');
2527 else if (funcArgs.
nArg1 == -1)
2528 sStr.append(maxLength - sStr.size(),
' ');
2529 else if (funcArgs.
nArg1 == 0)
2531 size_t leftSpace = (maxLength - sStr.size()) / 2;
2532 size_t rightSpace = maxLength - leftSpace - sStr.size();
2533 sStr.insert(0, leftSpace,
' ');
2534 sStr.append(rightSpace,
' ');
2591 return sVersionInfo;
2639 sFileInfo.
push_back(
"ModificationTime");
2658 else if (funcArgs.
nArg1 == 1)
2661 ".dat",
false,
true);
2666 std::fstream file(sFileName, std::ios_base::in | std::ios_base::binary);
2667 return "\"" + sha256(file) +
"\"";
2686 std::map<std::string, StringFuncHandle> mHandleTable;
2759 return mHandleTable;
const std::string sVersion
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
This class implements the basic input/ output file system and provides functionalities to work with f...
std::vector< std::string > getFileParts(const std::string &sFilePath) const
This member function separates all path parts into single strings: the drive letter,...
FileInfo getFileInfo(const std::string &sFilePath) const
Return the file information about the passed file path.
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
void setTokens(std::string _sTokens)
This member function may be used to update the path placeholders of the current FileSystem instance.
void declareFileType(const std::string &sFileType)
int setPath(std::string _sPath, bool bMkDir, std::string _sExePath)
This member function may be used to set the preferred file path of the current FileSystem instance.
std::vector< std::string > getList(const std::string &sMessageScheme) const
This member function returns a vector of language strings matching to the passed identifier containin...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
FileSystem & getFileSystem()
static void issueWarning(std::string sWarningMessage)
This static function may be used to issue a warning to the user. The warning will be printed by the t...
size_t getPrecision() const
Returns the precision for displaying floating numbers in the terminal. This value determines the numb...
std::string getTokenPaths() const
Returns a semicolon-separated list of the current defined path placeholders and their values.
std::string getExePath() const
Returns the current application root folder path.
StringView view() const
Get a view to the contained string.
bool is_string() const
Determine, whether the contained string represents a string literal.
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...
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.
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...
bool is_string(size_t i) const
Check whether the i-th element represents a string or a numeric value.
size_t rfind(const std::string &findstr, size_t pos=std::string::npos) const
Wrapper member function for std::string::rfind()
void strip()
This member function shrinks the viewed section to remove all leading or trailing whitespace characte...
void trim_front(size_t len)
This member function can be used to remove characters from the front of the viewed section.
size_t find_first_of(const std::string &findstr, size_t pos=0) const
Wrapper member function for std::string::find_first_of()
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()
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()
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)....
void trim_back(size_t len)
This member function can be used to remove characters from the back of the viewed section.
size_t find(const std::string &findstr, size_t pos=0) const
Wrapper member function for std::string::find()
size_t length() const
This member function simply returns the length of the viewed section.
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()
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...
Common exception class for all exceptions thrown in NumeRe.
static size_t invalid_position
CONSTCD11 date::year year() const NOEXCEPT
CONSTCD11 date::day day() const NOEXCEPT
CONSTCD11 date::month month() const NOEXCEPT
std::string errorTypeToString(ErrorType e)
Return the error type converted to a human readable string.
std::string getLastErrorMessage()
Return the last error message, which was catched by the getErrorType() function.
ErrorType getLastErrorType()
Return the last error type, which was catched by the getErrorType() function.
bool is_file(std::string sPathname)
This function checks whether a given string is a valid file path.
bool is_dir(std::string sPathname)
This function checks whether a given string is a valid directory path.
bool fileExists(const string &)
This function checks, whether the file with the passed file name exists.
unsigned int getMatchingParenthesis(const StringView &)
Returns the position of the closing parenthesis.
std::complex< double > intPower(const std::complex< double > &, int)
This function calculates the power of a value with the specialization that the exponent is an integer...
static const char MONTH[]
static const char STATUS_SHORT[]
static const char UBUNTU_VERSION_STYLE[]
CONSTDATA date::month oct
sys_time< days > sys_days
MUP_BASETYPE value_type
The numeric datatype used by the parser.
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
int StrToInt(const std::string &)
Converts a string into an integer.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
@ STR_STR_STR_VALOPT_VALOPT
static StringVector strfnc_getfolderlist(StringFuncArgs &funcArgs)
Implementation of the getfolderlist() function.
static StringVector strfnc_str_not_rmatch(StringFuncArgs &funcArgs)
Implementation of the str_not_rmatch() function.
static StringVector strfnc_timeformat(StringFuncArgs &funcArgs)
Implementation of the timeformat() function.
static StringVector strfnc_isblank(StringFuncArgs &funcArgs)
Implementation of the is_blank() function.
static StringVector strfnc_getversioninfo(StringFuncArgs &funcArgs)
Implementation of the getversioninfo() function.
static StringVector strfnc_to_char(StringFuncArgs &funcArgs)
Implementation of the to_char() function.
static StringVector strfnc_strrfnd(StringFuncArgs &funcArgs)
Implementation of the strrfnd() function.
static StringVector strfnc_strfndall(StringFuncArgs &funcArgs)
Implementation of the strfndall() function.
static StringVector strfnc_regex(StringFuncArgs &funcArgs)
Implementation of the regex() function.
static StringVector strfnc_strunique(StringFuncArgs &funcArgs)
Implementation of the strunique() function.
static std::map< std::string, StringFuncHandle > getStringFuncHandles()
This static function is used to construct the string map.
static StringVector strfnc_strrmatch(StringFuncArgs &funcArgs)
Implementation of the strrmatch() function.
static StringVector strfnc_basetodec(StringFuncArgs &funcArgs)
Implementation of the basetodec() function.
static StringVector strfnc_dectobase(StringFuncArgs &funcArgs)
Implementation of the dectobase() function.
static StringVector strfnc_isxdigit(StringFuncArgs &funcArgs)
Implementation of the is_xdigit() function.
static StringVector strfnc_islower(StringFuncArgs &funcArgs)
Implementation of the is_lower() function.
static StringVector strfnc_getfilelist(StringFuncArgs &funcArgs)
Implementation of the getfilelist() function.
static StringVector strfnc_isprint(StringFuncArgs &funcArgs)
Implementation of the is_print() function.
static StringVector strfnc_iscntrl(StringFuncArgs &funcArgs)
Implementation of the is_cntrl() function.
static StringVector strfnc_and(StringFuncArgs &funcArgs)
Implementation of the and() function.
static StringVector strfnc_max(StringFuncArgs &funcArgs)
Implementation of the max() function.
static StringVector strfnc_locate(StringFuncArgs &funcArgs)
Implementation of the locate() function.
string removeQuotationMarks(const std::string &sString)
This function simply removes the surrounding quotation marks.
static StringVector strfnc_strfnd(StringFuncArgs &funcArgs)
Implementation of the strfnd() function.
static StringVector strfnc_repeat(StringFuncArgs &funcArgs)
Implementation of the repeat() function.
static StringVector strfnc_isalnum(StringFuncArgs &funcArgs)
Implementation of the is_alnum() function.
static std::string formatNumberToTex(const mu::value_type &number, size_t precision=0)
This function converts a number into a tex string.
static StringVector strfnc_str_not_match(StringFuncArgs &funcArgs)
Implementation of the str_not_match() function.
static StringVector strfnc_weekday(StringFuncArgs &funcArgs)
Implementation of the weekday() function.
static StringVector strfnc_xor(StringFuncArgs &funcArgs)
Implementation of the xor() function.
static StringVector strfnc_isfile(StringFuncArgs &funcArgs)
Implementation of the is_file() function.
static StringVector strfnc_to_time(StringFuncArgs &funcArgs)
Implementation of the to_time() function.
static StringVector strfnc_num(StringFuncArgs &funcArgs)
Implementation of the num() function.
static StringVector strfnc_findtoken(StringFuncArgs &funcArgs)
Implementation of the findtoken() function.
static StringVector strfnc_or(StringFuncArgs &funcArgs)
Implementation of the or() function.
static StringVector strfnc_findfile(StringFuncArgs &funcArgs)
Implementation of the findfile() function.
static double extractLaTeXExponent(std::string &sExpr)
Simple helper to parse the exponents in LaTeX format.
static StringVector strfnc_substr(StringFuncArgs &funcArgs)
Implementation of the substr() function.
static StringVector strfnc_split(StringFuncArgs &funcArgs)
Implementation of the split() function.
static StringVector strfnc_to_tex(StringFuncArgs &funcArgs)
Implementation of the to_tex() function.
static StringVector strfnc_isupper(StringFuncArgs &funcArgs)
Implementation of the is_upper() function.
static StringVector strfnc_getkeyval(StringFuncArgs &funcArgs)
Implementation of the getkeyval() function.
static long long int convertBaseToDecimal(StringView value, NumberBase base)
Static helper function for converting number bases into the decimal base.
static StringVector strfnc_sum(StringFuncArgs &funcArgs)
Implementation of the sum() function.
static StringVector strfnc_cnt(StringFuncArgs &funcArgs)
Implementation of the cnt() function.
static StringVector strfnc_isgraph(StringFuncArgs &funcArgs)
Implementation of the is_graph() function.
static StringVector strfnc_getenvvar(StringFuncArgs &funcArgs)
Implementation of the getenvvar() function.
static StringVector strfnc_to_string(StringFuncArgs &funcArgs)
Implementation of the to_string() function.
static StringVector strfnc_strmatch(StringFuncArgs &funcArgs)
Implementation of the strmatch() function.
static StringVector strfnc_replace(StringFuncArgs &funcArgs)
Implementation of the replace() function.
static StringVector strfnc_strip(StringFuncArgs &funcArgs)
Implementation of the strip() function.
static StringVector strfnc_findparam(StringFuncArgs &funcArgs)
Implementation of the findparam() function.
static StringVector strfnc_char(StringFuncArgs &funcArgs)
Implementation of the char() function.
static StringVector strfnc_isalpha(StringFuncArgs &funcArgs)
Implementation of the is_alpha() function.
static StringVector strfnc_isdir(StringFuncArgs &funcArgs)
Implementation of the is_dir() function.
static StringVector strfnc_min(StringFuncArgs &funcArgs)
Implementation of the min() function.
static std::string createLaTeXExponent(const std::string &sExp, bool negative)
Simple helper to create a LaTeX exponent from a string.
static StringVector strfnc_justify(StringFuncArgs &funcArgs)
Implementation of the justify function. Each string in a std::vector of strings is filled with whites...
static StringVector strfnc_getlasterror(StringFuncArgs &funcArgs)
Implementation of the getlasterror() function.
static StringVector strfnc_getopt(StringFuncArgs &funcArgs)
Implementation of the getopt() function.
static StringVector strfnc_ascii(StringFuncArgs &funcArgs)
Implementation of the ascii() function.
static StringVector strfnc_idxtolog(StringFuncArgs &funcArgs)
Implementation of the idxtolog() function.
static StringVector strfnc_isspace(StringFuncArgs &funcArgs)
Implementation of the is_space() function.
static StringVector strfnc_strmatchall(StringFuncArgs &funcArgs)
Implementation of the strmatchall() function.
static StringVector strfnc_replaceall(StringFuncArgs &funcArgs)
Implementation of the replaceall() function.
static StringVector strfnc_logtoidx(StringFuncArgs &funcArgs)
Implementation of the logtoidx() function.
static StringVector strfnc_sha256(StringFuncArgs &funcArgs)
Implementation of the sha256() function.
static StringVector strfnc_strlen(StringFuncArgs &funcArgs)
Implementation of the strlen() function.
static StringVector strfnc_to_lowercase(StringFuncArgs &funcArgs)
Implementation of the to_lowercase() function.
static std::string padWithZeros(int nTime, size_t nLength)
Creates a padding string full of 0.
string removeMaskedStrings(const std::string &sString)
This function removes the escape characters from the passed string.
static StringVector strfnc_getFileParts(StringFuncArgs &funcArgs)
Implementation of the getfileparts() function.
static StringVector strfnc_to_uppercase(StringFuncArgs &funcArgs)
Implementation of the to_uppercase() function.
static StringVector strfnc_isdigit(StringFuncArgs &funcArgs)
Implementation of the is_digit() function.
static StringVector strfnc_getmatchingparens(StringFuncArgs &funcArgs)
Implementation of the getmatchinparens() function.
string addQuotationMarks(const std::string &sString)
This function simply adds the surrounding quotation marks.
static StringVector strfnc_ispunct(StringFuncArgs &funcArgs)
Implementation of the is_punct() function.
static StringVector strfnc_getfileinfo(StringFuncArgs &funcArgs)
Implementation of the getfileinfo() function.
static StringVector strfnc_textparse(StringFuncArgs &funcArgs)
Implementation of the textparse() function.
This structure contains all relevant information about a file path.
This structure combines all string function's arguments into a single structure to align all string f...
This structure defines the internal string function signature. It contains the pointer to the actual ...
Structure containing the german umlauts. The lower field will contain lower case umlauts,...
This structure defines all fields necessary to create a time stamp or a formatted date.
date::year_month_day m_ymd
std::chrono::microseconds m_microsecs
std::chrono::minutes m_minutes
std::chrono::seconds m_seconds
std::chrono::hours m_hours
std::chrono::milliseconds m_millisecs
This structure defines the information for a time zone.
std::string toString(int)
Converts an integer to a string without the Settings bloat.