NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include "stringtools.hpp"
#include "../settings.hpp"
#include "../structures.hpp"
#include "fast_float/fast_float.h"
#include <cstring>
#include <sstream>
#include <iomanip>
Go to the source code of this file.
Functions | |
std::string | getNextArgument (std::string &sArgList, bool bCut) |
double | intPower (double, int) |
This function calculates the power of a value with the specialization that the exponent is an integer. More... | |
std::string | toString (int nNumber, const Settings &_option) |
Converts an integer to a string. More... | |
std::string | toString (double dNumber, const Settings &_option) |
Converts a double to a string using the precision from the Settings object. More... | |
std::string | toString (double dNumber, int nPrecision) |
Converts a double to a string using the passed precision. More... | |
std::string | toString (const std::complex< double > &dNumber, int nPrecision) |
Converts a complex number into a printable string. More... | |
std::string | toString (int nNumber) |
Converts an integer to a string without the Settings bloat. More... | |
std::string | toString (size_t nNumber) |
Converts an unsigned integer to a string. More... | |
std::string | toString (__time64_t tTime, int timeStampFlags) |
Converts a time_t to a string. Will actually print a timestamp. More... | |
std::string | toString (sys_time_point tp, int timeStampFlags) |
Converts a sys_time_point to a string. More... | |
std::string | toString (long long int nNumber) |
Converts a long long int to a string. More... | |
std::string | toString (bool bBoolean) |
Converts a boolean to a string by actually converting the numerical value to "true" and "false" . More... | |
std::string | toCmdString (double dNumber) |
Converts a numerical value into a "full" precision string. More... | |
std::string | toCmdString (const std::complex< double > &dNumber) |
Converts a numerical value into a "full" precision string. More... | |
std::string | toHexString (int nNumber) |
Converts an integer to a hexadecimal number printed as string. More... | |
std::vector< std::string > | toStrVector (std::string sString) |
This function converts a std::string into a std::vector, where the string shall be passed as "{x,y,z,...}". More... | |
std::vector< int > | toIntVector (std::string sString) |
This function converts a std::string into a std::vector, where the string shall be passed as "{x,y,z,...}". More... | |
std::string | condenseText (const std::string &sText) |
Removes vowels and umlauts from the passed string. More... | |
std::string | truncString (const std::string &sText, size_t nMaxChars) |
This function truncates the string to the passed max length (including a trailing ellipsis) or returns it unmodified, if it is shorter. More... | |
void | StripSpaces (std::string &sToStrip) |
Removes leading and trailing white spaces and tabulator characters. More... | |
int | StrToInt (const std::string &sString) |
Converts a string into an integer. More... | |
double | StrToDb (const std::string &sString) |
Converts a string into a double. More... | |
double | StrToLogical (const std::string &sString) |
Converts a string into a double considering logical values. More... | |
std::complex< double > | StrToCmplx (const std::string &sString) |
Converts a string into a complex number. More... | |
sys_time_point | StrToTime (const std::string &sString) |
Convert a string to a sys_time_point. More... | |
size_t | versionToInt (std::string sVersion) |
Converts a version string into a multi-digit integer. More... | |
std::string | intToVersion (size_t nVersionDigits) |
Converts a multi-digit integer into a verison string. More... | |
std::string | toInternalString (std::string sStr) |
Converts a string literal to the internal representation in tables and clusters. More... | |
std::string | toExternalString (std::string sStr) |
Converts an internal string to the external representation in the terminal. More... | |
std::string | toLowerCase (const std::string &sUpperCase) |
Converts uppercase to lowercase letters. More... | |
std::string | toUpperCase (const std::string &sLowerCase) |
Converts lowercase letters to uppercase ones. More... | |
static bool | isDateTimePattern (const std::string &sStr, size_t pos) |
Static function to determine, whether the character at passed position fits the pattern needed for a date. More... | |
bool | isConvertible (const std::string &sStr, ConvertibleType type) |
This function checks, whether a string can be converted to the selected ConvertibleType. More... | |
static int | isDatePattern_US (const std::string &sStr, size_t i) |
Returns a formatting flag combination, if the string is a US-specific date pattern or TD_NONE. More... | |
static int | isDatePattern_DE (const std::string &sStr, size_t i) |
Returns a formatting flag combination, if the string is a DE-specific date pattern or TD_NONE. More... | |
static int | isTimePattern (const std::string &sStr, size_t i) |
Returns a formatting flag combination, if the string is a time pattern or TD_NONE. More... | |
int | detectTimeDateFormat (const std::string &sStr) |
Detects the contained date-time format and returns it as a bitflag composition. More... | |
std::string | wcstombs (const std::wstring &wStr) |
This function is a wrapper for the usual wcstombs function, which can handle wstrings. More... | |
std::string | toSystemCodePage (std::string sOutput) |
Converts an internal to an external string. Does nothing currently. More... | |
std::string | fromSystemCodePage (std::string sOutput) |
Transforms the system code page to the internal one. More... | |
std::string | utf8parser (const std::string &sString) |
Transforms a UTF8 encoded string into a standard ASCII string in the internal code page representation. More... | |
std::string | getTimeStamp (bool bGetStamp) |
This function simple returns the current time as a default timestamp. More... | |
std::vector< std::string > | split (const std::string &sStr, char cSplit) |
Splits a vector at the selected characters. More... | |
std::string | ellipsize (const std::string &sLongString, size_t nMaxStringLength) |
Shortens the passed string by introducing a ellipsis in the middle of the string, if the string is longer than the maximal string length. More... | |
void | replaceAll (std::string &sToModify, const char *sToRep, const char *sNewValue, size_t nStart, size_t nEnd) |
This function replaces all occurences of the string sToRep in the string sToModify with the new value sNewValue. The boundaries limit the range of processing. More... | |
void | replaceAll (std::string &sToModify, const std::string &sToRep, const std::string &sNewValue, size_t nStart, size_t nEnd) |
This function replaces all occurences of the string sToRep in the string sToModify with the new value sNewValue. The boundaries limit the range of processing. This function is a (slower) overload for std::strings. More... | |
std::string | replaceControlCharacters (std::string sToModify) |
This function is a simple wrapper for replaceAll() and specialized to remove control characters from strings. More... | |
std::string | replacePathSeparator (const std::string &__sPath) |
This function replaces the Windows style path sparators to UNIX style. More... | |
bool | isEqualStripped (StringView str1, StringView str2) |
Returns true, if the contents of the strings are equal, if all surrounding whitespaces will be stripped. More... | |
std::string condenseText | ( | const std::string & | sText | ) |
Removes vowels and umlauts from the passed string.
sText | const std::string& |
Definition at line 412 of file stringtools.cpp.
Referenced by createOutputForHist1D().
int detectTimeDateFormat | ( | const std::string & | sStr | ) |
Detects the contained date-time format and returns it as a bitflag composition.
sStr | const std::string& |
Definition at line 1175 of file stringtools.cpp.
References date::format(), isDatePattern_DE(), isDatePattern_US(), isTimePattern(), TD_HHMMSS, TD_NONE, TD_SEP_COLON, TD_SEP_MINUS, TD_UTC, and TD_YYMMDD.
Referenced by StrToTime().
std::string ellipsize | ( | const std::string & | sLongString, |
size_t | nMaxStringLength | ||
) |
Shortens the passed string by introducing a ellipsis in the middle of the string, if the string is longer than the maximal string length.
sLongString | const std::string& |
nMaxStringLength | size_t |
Definition at line 1420 of file stringtools.cpp.
Referenced by NumeReDebugger::getGlobals(), NumeRe::Cluster::getShortVectorRepresentation(), and NumeReKernel::getVariableList().
std::string fromSystemCodePage | ( | std::string | sOutput | ) |
Transforms the system code page to the internal one.
sOutput | std::string |
Definition at line 1267 of file stringtools.cpp.
Referenced by Plot::CoordSettings(), Plot::create2dPlot(), Plot::createPlotOrAnimation(), Plot::createStd3dPlot(), Plot::createStdPlot(), fileExists(), listFiles(), FileSystem::setPath(), and NumeReKernel::uninstallPlugin().
std::string getNextArgument | ( | std::string & | sArgList, |
bool | bCut | ||
) |
Definition at line 2294 of file tools.cpp.
References getNextCommandLineToken(), and StringViewBase::to_string().
Referenced by NumeReEditor::AbstrahizeSection(), NumeReEditor::AddProcedureDocumentation(), CodeAnalyzer::analyseCommands(), NumeRe::StringFuncHandler::applySpecialStringFuncs(), applyValueHeuristics(), NumeRe::StringFuncHandler::argumentParser(), FlowCtrl::checkCaseValue(), cmd_pack(), cmd_remove(), cmd_rename(), convertVectorToExpression(), Plot::createDataLegends(), ProcedureVarFactory::createLocalClusters(), ProcedureVarFactory::createLocalInlineStrings(), ProcedureVarFactory::createLocalInlineVars(), ProcedureVarFactory::createLocalStrings(), ProcedureVarFactory::createLocalTables(), ProcedureVarFactory::createLocalVars(), createMatFromLines(), createMatFromLinesFilled(), ProcedureVarFactory::createProcedureArguments(), Plot::createSubPlotSet(), NumeReDebugger::decodeType(), deleteCacheEntry(), dialogCommand(), differentiate(), NumeRe::StringParser::eval(), evalMatOp(), ProcedureVarFactory::evaluateProcedureArguments(), NumeRe::StringVarFactory::evaluateStringVectors(), NumeRe::FindProcedureDefinition(), SearchController::FindProcedureDefinitionInLocalFile(), NumeReEditor::GetCurrentArgument(), CommandLineParser::getParameterValueAsNumericalValue(), Script::handleInstallInformation(), Package::importDefinition(), newObject(), FunctionDefinition::parse(), NumeRe::StringParser::parseStringsInIndices(), FlowCtrl::prepareSwitchExpression(), replaceEntityOccurence(), PackageRepoBrowser::resolveDependencies(), Plot::separateFunctionsAndData(), PlotData::setParams(), NumeReWindow::showDirDialog(), NumeReWindow::showFileDialog(), NumeReWindow::showListDialog(), NumeReWindow::showSelectionDialog(), NumeReWindow::showTextEntry(), FunctionDefinition::splitAndValidateArguments(), NumeRe::StringParser::storeStringResults(), swapTables(), tableMethod_anova(), tableMethod_binsof(), tableMethod_categorize(), tableMethod_convert(), tableMethod_counteq(), tableMethod_cov(), tableMethod_findCols(), tableMethod_index(), tableMethod_pcorr(), tableMethod_rank(), tableMethod_scorr(), tableMethod_zscore(), toStrVector(), undefineFunctions(), NumeReKernel::uninstallPlugin(), and writeToFile().
std::string getTimeStamp | ( | bool | bGetStamp | ) |
This function simple returns the current time as a default timestamp.
bGetStamp | bool |
Definition at line 1373 of file stringtools.cpp.
References GET_AS_TIMESTAMP, GET_WITH_TEXT, and toString().
Referenced by NumeReHistory::addHeader(), createTeXExport(), fitDataSet(), NumeRe::FileAdapter::getDate(), NumeReEditor::getTemplateContent(), NumeReWindow::NewFile(), prepareTemplate(), Script::startInstallation(), NumeReKernel::StartUp(), NumeRe::TextDataFile::writeHeader(), NumeRe::LaTeXTable::writeHeader(), and Procedure::writeProcedure().
double intPower | ( | double | dNumber, |
int | nExponent | ||
) |
This function calculates the power of a value with the specialization that the exponent is an integer.
dNumber | double |
nExponent | int |
Definition at line 3607 of file tools.cpp.
References date::abs().
Referenced by StrToTime().
std::string intToVersion | ( | size_t | nVersionDigits | ) |
Converts a multi-digit integer into a verison string.
nVersionDigits | size_t |
Definition at line 815 of file stringtools.cpp.
References toString().
Referenced by incrementVersion().
bool isConvertible | ( | const std::string & | sStr, |
ConvertibleType | type | ||
) |
This function checks, whether a string can be converted to the selected ConvertibleType.
sStr | const std::string& |
type | ConvertibleType |
Definition at line 1009 of file stringtools.cpp.
References CONVTYPE_DATE_TIME, CONVTYPE_LOGICAL, CONVTYPE_VALUE, isConvertible(), isDateTimePattern(), and toLowerCase().
Referenced by StringColumn::convert(), CategoricalColumn::convert(), NumeRe::ClusterStringItem::getDouble(), isConvertible(), NumeRe::GenericFile::isNumeric(), NumeRe::Table::isNumerical(), CellValueShaderDialog::OnButtonClick(), NumeRe::CommaSeparatedValues::readFile(), NumeRe::ClusterDoubleItem::setString(), ValueColumn::setValue(), DateTimeColumn::setValue(), LogicalColumn::setValue(), NumeRe::Table::setValueAsString(), strfnc_textparse(), and strfnc_to_time().
|
static |
Returns a formatting flag combination, if the string is a DE-specific date pattern or TD_NONE.
sStr | const std::string& |
i | size_t |
Definition at line 1121 of file stringtools.cpp.
References TD_DDMM, TD_DDMMYY, TD_NONE, and TD_SEP_DOT.
Referenced by detectTimeDateFormat().
|
static |
Returns a formatting flag combination, if the string is a US-specific date pattern or TD_NONE.
sStr | const std::string& |
i | size_t |
Definition at line 1088 of file stringtools.cpp.
References TD_DDMMYY, TD_NONE, TD_SEP_MINUS, TD_SEP_SLASH, and TD_YYMMDD.
Referenced by detectTimeDateFormat().
|
static |
Static function to determine, whether the character at passed position fits the pattern needed for a date.
sStr | const std::string& |
pos | size_t |
Definition at line 984 of file stringtools.cpp.
Referenced by isConvertible().
bool isEqualStripped | ( | StringView | str1, |
StringView | str2 | ||
) |
Returns true, if the contents of the strings are equal, if all surrounding whitespaces will be stripped.
str1 | StringView |
str2 | StringView |
Definition at line 1574 of file stringtools.cpp.
References StringViewBase::strip().
Referenced by evalMatOp().
|
static |
Returns a formatting flag combination, if the string is a time pattern or TD_NONE.
sStr | const std::string& |
i | size_t |
Definition at line 1150 of file stringtools.cpp.
References TD_HHMM, TD_HHMMSS, TD_NONE, and TD_SEP_COLON.
Referenced by detectTimeDateFormat().
void replaceAll | ( | std::string & | sToModify, |
const char * | sToRep, | ||
const char * | sNewValue, | ||
size_t | nStart, | ||
size_t | nEnd | ||
) |
This function replaces all occurences of the string sToRep in the string sToModify with the new value sNewValue. The boundaries limit the range of processing.
sToModify | std::string& |
sToRep | const char* |
sNewValue | const char* |
nStart | size_t |
nEnd | size_t |
Definition at line 1443 of file stringtools.cpp.
Referenced by NumeRe::addLinebreaks(), NumeReEditor::AddProcedureDocumentation(), applySyntaxHighlighting(), StringColumn::convert(), CategoricalColumn::convert(), createCssString(), DocumentationGenerator::createMainProcedure(), DocumentationGenerator::createParametersTable(), DocumentationGenerator::createReturnsTable(), NumeRe::StringParser::createTerminalOutput(), NumeRe::TextDataFile::decodeTableHeads(), Dependencies::Dependencies(), PackageRepoBrowser::DetectInstalledPackages(), NumeReKernel::failMessage(), formatNumberToTex(), getHighlightedCode(), NumeReKernel::getPluginLanguageStrings(), NumeReKernel::issueWarning(), listDirectory(), NumeRe::StringParser::maskControlCharacters(), newObject(), NumeReWindow::OnCreatePackage(), openExternally(), DocumentationGenerator::parseDocumentation(), parseEventOpt(), parseLayoutCommand(), parseLayoutScript(), PackageRepoBrowser::populatePackageList(), NumeRe::TextDataFile::readFile(), readFromFile(), NumeRe::JcampDX::readTable(), replaceControlCharacters(), Dependencies::resolveProcedureCalls(), FlowCtrl::setCommand(), strfnc_replaceall(), strfnc_textparse(), toExternalString(), urlExecute(), versionToInt(), and Script::writeWholeFile().
void replaceAll | ( | std::string & | sToModify, |
const std::string & | sToRep, | ||
const std::string & | sNewValue, | ||
size_t | nStart, | ||
size_t | nEnd | ||
) |
This function replaces all occurences of the string sToRep in the string sToModify with the new value sNewValue. The boundaries limit the range of processing. This function is a (slower) overload for std::strings.
sToModify | std::string& |
sToRep | const std::string& |
sNewValue | const std::string& |
nStart | size_t |
nEnd | size_t |
Definition at line 1490 of file stringtools.cpp.
std::string replaceControlCharacters | ( | std::string | sToModify | ) |
This function is a simple wrapper for replaceAll() and specialized to remove control characters from strings.
sToModify | std::string |
Definition at line 1531 of file stringtools.cpp.
References replaceAll().
Referenced by NumeReDebugger::decodeType(), NumeReDebugger::getGlobals(), GridNumeReTable::GetValue(), NumeReKernel::getVariableList(), and TableViewer::SetData().
std::string replacePathSeparator | ( | const std::string & | __sPath | ) |
This function replaces the Windows style path sparators to UNIX style.
__sPath | const std::string& |
Definition at line 1548 of file stringtools.cpp.
Referenced by BreakpointManager::addBreakpoint(), PackageDialog::autoDetect(), DependencyDialog::calculateDependencies(), FileSystem::cleanPath(), BreakpointManager::clearBreakpoints(), cmd_unpack(), DocumentationGenerator::createDocumentation(), DocumentationGenerator::createFullDocumentation(), Dependencies::Dependencies(), dialogCommand(), doc_ReplaceTokensForHTML(), doc_SearchFct(), NumeReWindow::EvaluateCommandLine(), NumeReWindow::EvaluateTab(), SearchController::FindMarkedInclude(), PackageDialog::followBranch(), DocumentationGenerator::followBranch(), getFileList(), getFolderList(), VersionControlSystemManager::getRevisionPath(), initializeFileHandle(), BreakpointManager::isBreakpoint(), Filewatcher::isDefaultPath(), NumeReWindow::isOnReloadBlackList(), moveOrCopyFiles(), newObject(), NumeRe::StringParser::numToString(), PackageDialog::OnAddItems(), OptionsDialog::OnButtonClick(), NumeReEditor::OnChar(), NumeReWindow::OnCopyAsPath(), NumeReDropTarget::OnData(), NumeReWindow::OnExecuteFile(), NumeReWindow::OnFileEventTimer(), NumeReWindow::OnMenuEvent(), NumeReWindow::OpenFileByType(), BreakpointManager::removeBreakpoint(), NumeReWindow::SaveTab(), PackageDialog::setMainFile(), EditorNotebook::SetTabText(), shortenFileName(), and Archive::unpack().
std::vector< std::string > split | ( | const std::string & | sStr, |
char | cSplit | ||
) |
Splits a vector at the selected characters.
sStr | const std::string& |
cSplit | char |
Definition at line 1388 of file stringtools.cpp.
Referenced by date::detail::Rule::split_overlaps(), and StrToTime().
void StripSpaces | ( | std::string & | sToStrip | ) |
Removes leading and trailing white spaces and tabulator characters.
sToStrip | std::string& |
Definition at line 463 of file stringtools.cpp.
Referenced by NumeReEditor::AbstrahizeSection(), PackageManager::addHelpIndex(), addLegends(), CodeAnalyzer::analyseCommands(), CodeAnalyzer::analyseFunctions(), NumeRe::StringParser::applyElementaryStringOperations(), NumeRe::StringFuncHandler::applySpecialStringFuncs(), applyValueHeuristics(), FlowCtrl::calc(), FunctionDefinitionManager::call(), FlowCtrl::checkParsingModeAndExpandDefinitions(), ProcedureElement::cleanCurrentLine(), FileSystem::cleanPath(), cmd_ifndefined(), cmd_install(), cmd_readline(), cmd_rename(), commandHandler(), FlowCtrl::compile(), NumeRe::StringLogicParser::concatenateStrings(), confirmOperation(), Plot::create2dPlot(), Plot::createDataLegends(), ProcedureVarFactory::createLocalClusters(), ProcedureVarFactory::createLocalInlineStrings(), ProcedureVarFactory::createLocalInlineVars(), ProcedureVarFactory::createLocalStrings(), ProcedureVarFactory::createLocalTables(), ProcedureVarFactory::createLocalVars(), ProcedureVarFactory::createProcedureArguments(), Plot::createStd3dPlot(), Plot::createStdPlot(), Plot::createSubPlotSet(), SymDefManager::createSymbol(), FunctionDefinition::decodeDefinition(), decodeNameSpace(), deleteCacheEntry(), differentiate(), doc_Help(), doc_HelpAsHTML(), editObject(), NumeRe::StringParser::eval(), FlowCtrl::evalHeader(), PackageManager::evalPluginCmd(), FlowCtrl::evalRangeBasedHeader(), NumeRe::StringLogicParser::evalStringLogic(), NumeRe::StringLogicParser::evalStringTernary(), evaluateFittingParams(), ProcedureVarFactory::evaluateProcedureArguments(), NumeReKernel::evaluateProcedureCalls(), Plot::evaluateSubplot(), Procedure::execute(), executeCommand(), NumeReKernel::executePlugins(), FlowCtrl::extractFlagsAndIndexVariables(), FlowCtrl::fillJumpTableAndExpandRecursives(), findArticleById(), findCommand(), findExtrema(), NumeRe::FindProcedureDefinition(), SearchController::FindProcedureDefinitionInLocalFile(), findZeroes(), fitDataSet(), FlowCtrl::for_loop(), Documentation::getArgAtPos(), getArgAtPos(), getDataElements(), NumeRe::StringParser::getDataForString(), NumeRe::DataBase::getDBFileContent(), FunctionDefinition::getDefinition(), CommandLineParser::getExprAsFileName(), CommandLineParser::getExprAsMathExpression(), Fitcontroller::getFitFunction(), getIndices(), Procedure::getInlined(), getIntervalForSearchFunctions(), Language::getLangFileContent(), getLastToken(), NumeReKernel::getline(), Includer::getNextLine(), Script::getNextScriptCommandFromScript(), Package::getOptionValue(), getParameterValue(), CommandLineParser::getParameterValueAsString(), NumeReKernel::handleCommandLineSource(), Procedure::handleIncludeSyntax(), Script::handleInstallInformation(), NumeReKernel::handleToCmd(), FunctionDefinition::importFunction(), isClusterCandidate(), FunctionDefinitionManager::isDefined(), listDirectory(), listFiles(), load_data(), loadDocumentationArticle(), DocumentationFile::loadFromFile(), PackageManager::loadPlugins(), NumeReKernel::MainLoop(), moveOrCopyFiles(), Includer::openIncludedFile(), FunctionDefinition::parse(), CommandLineParser::parse(), MemoryManager::parseEvery(), CommandLineParser::parseExprAsString(), parseLayoutCommand(), parseLayoutScript(), mu::ParserBase::ParseString(), parseStringOpt(), performMatrixOperation(), Plot::Plot(), plugin_histogram(), NumeRe::StringLogicParser::prepareComparisonValues(), FlowCtrl::prepareLocalVarsAndReplace(), Procedure::ProcCalc(), Procedure::procedureCmdInterface(), ProcedureElement::ProcedureElement(), Procedure::procedureInterface(), promptForUserInput(), FlowCtrl::range_based_for_loop(), NumeRe::CassyLabx::readFile(), NumeRe::CommaSeparatedValues::readFile(), NumeRe::JcampDX::readFile(), readFromFile(), NumeRe::JcampDX::readTable(), NumeRe::realignLangString(), removeObsoleteParentheses(), NumeRe::StringParser::replaceDataOccurence(), FlowCtrl::replaceLocalVars(), Procedure::replaceReturnVal(), replaceToTeX(), FunctionDefinitionManager::resolveRecursiveDefinitions(), CodeAnalyzer::run(), Plot::separateFunctionsAndData(), Settings::set(), FlowCtrl::setCommand(), PlotData::setParams(), Odesolver::solve(), NumeReEditor::sortSelection(), NumeRe::StringExpression::split(), FunctionDefinition::splitAndValidateArguments(), Script::startInstallation(), NumeRe::StringParser::storeStringResults(), strfnc_textparse(), stripComments(), StrToTime(), swapTables(), taylor(), windowCommand(), Script::writeDocumentationArticle(), Script::writeLayout(), Script::writeProcedure(), Procedure::writeProcedure(), and writeToFile().
std::complex< double > StrToCmplx | ( | const std::string & | sString | ) |
Converts a string into a complex number.
sString | std::string& const |
Definition at line 528 of file stringtools.cpp.
References fast_float::from_chars_result::ec, fast_float::from_chars(), fast_float::from_chars_result::ptr, and toLowerCase().
Referenced by TableViewer::CellToCmplx(), StringColumn::convert(), CategoricalColumn::convert(), NumeRe::ClusterStringItem::getDouble(), CellValueShaderDialog::OnButtonClick(), NumeRe::ClusterDoubleItem::setString(), ValueColumn::setValue(), NumeRe::Table::setValueAsString(), strfnc_textparse(), and StrToLogical().
double StrToDb | ( | const std::string & | sString | ) |
Converts a string into a double.
sString | const std::string& |
Definition at line 495 of file stringtools.cpp.
Referenced by NumeRe::CassyLabx::extractValueFromTag(), getIntervalDef(), CommandLineParser::getParameterValueAsNumericalValue(), DuplicateCodeDialog::OnColumnHeaderClick(), NumeRe::JcampDX::parseLine(), NumeRe::StringParser::parseStringsInIndices(), plugin_histogram(), prepareTicksForHist1d(), NumeRe::JcampDX::readFile(), and NumeRe::JcampDX::readTable().
int StrToInt | ( | const std::string & | sString | ) |
Converts a string into an integer.
sString | const std::string& |
Definition at line 482 of file stringtools.cpp.
Referenced by determineWindowSize(), NumeRe::XLSXSpreadSheet::evalIndices(), evalMatOp(), Sorter::evaluateKeyList(), NumeRe::OpenDocumentSpreadSheet::expandLine(), NumeRe::SavitzkyGolayFilter::findColumn(), NumeReDebugger::gatherLoopBasedInformations(), getItemId(), NumeReWindow::gotoLine(), DuplicateCodeDialog::highlightSelection(), Settings::import_v1x(), Settings::load(), NumeRe::JcampDX::parseLine(), NumeReWindow::prepareSession(), Options::readAnalyzerOptionsFromConfig(), NumeRe::CassyLabx::readFile(), NumeRe::JcampDX::readFile(), NumeRe::JcampDX::readTable(), Settings::set(), strfnc_to_time(), SyntaxStyles::StrToColorNew(), SyntaxStyles::StrToColorOld(), StrToTime(), toIntVector(), and versionToInt().
double StrToLogical | ( | const std::string & | sString | ) |
Converts a string into a double considering logical values.
sString | const std::string& |
Definition at line 509 of file stringtools.cpp.
References StrToCmplx(), and toLowerCase().
Referenced by StringColumn::convert(), CategoricalColumn::convert(), LogicalColumn::setValue(), and NumeRe::Table::setValueAsString().
sys_time_point StrToTime | ( | const std::string & | sString | ) |
Convert a string to a sys_time_point.
sString | const std::string& |
Definition at line 626 of file stringtools.cpp.
References detectTimeDateFormat(), date::format(), getTimePointFromTimeStamp(), getTimeStampFromTimePoint(), intPower(), time_stamp::m_hours, time_stamp::m_microsecs, time_stamp::m_millisecs, time_stamp::m_minutes, time_stamp::m_seconds, time_stamp::m_ymd, split(), StripSpaces(), StrToInt(), sys_time_now(), TD_DDMM, TD_DDMMYY, TD_HHMM, TD_HHMMSS, TD_NONE, TD_SEP_MINUS, TD_SEP_SLASH, TD_YYMMDD, and date::year_month_day::year().
Referenced by StringColumn::convert(), CategoricalColumn::convert(), CellValueShaderDialog::OnButtonClick(), DateTimeColumn::setValue(), NumeRe::Table::setValueAsString(), strfnc_textparse(), and strfnc_to_time().
std::string toCmdString | ( | const std::complex< double > & | dNumber | ) |
Converts a numerical value into a "full" precision string.
dNumber | const std::complex<double>& |
Definition at line 325 of file stringtools.cpp.
References toString().
std::string toCmdString | ( | double | dNumber | ) |
Converts a numerical value into a "full" precision string.
dNumber | double |
Definition at line 308 of file stringtools.cpp.
Referenced by calculatePercentageAvgAndCreateParserVariables(), NumeRe::StringParser::createStringOutput(), evaluateParameterValues(), NumeRe::StringVarFactory::evaluateStringVectors(), DateTimeColumn::getValueAsString(), replaceDataEntities(), replaceEntityOccurence(), strfnc_getfileinfo(), strfnc_to_time(), and NumeRe::Cluster::to_string().
std::string toExternalString | ( | std::string | sStr | ) |
Converts an internal string to the external representation in the terminal.
sStr | std::string |
Definition at line 881 of file stringtools.cpp.
References replaceAll().
Referenced by NumeReDebugger::gatherLoopBasedInformations(), NumeReDebugger::getGlobals(), NumeRe::ClusterDoubleItem::getString(), NumeRe::ClusterStringItem::getString(), StringColumn::getValueAsStringLiteral(), and NumeReKernel::getVariableList().
std::string toHexString | ( | int | nNumber | ) |
Converts an integer to a hexadecimal number printed as string.
nNumber | int |
Definition at line 339 of file stringtools.cpp.
References fast_float::hex.
Referenced by mu::ParserByteCode::AsciiDump(), and NumeReKernel::initializeStackTracker().
std::string toInternalString | ( | std::string | sStr | ) |
Converts a string literal to the internal representation in tables and clusters.
sStr | std::string |
Definition at line 844 of file stringtools.cpp.
Referenced by ProcedureVarFactory::createLocalInlineStrings(), StringVector::makeLocalString(), CommandLineParser::parseExprAsString(), NumeRe::ClusterDoubleItem::setString(), ValueColumn::setValue(), DateTimeColumn::setValue(), and LogicalColumn::setValue().
std::vector< int > toIntVector | ( | std::string | sString | ) |
This function converts a std::string into a std::vector, where the string shall be passed as "{x,y,z,...}".
sString | std::string |
Definition at line 387 of file stringtools.cpp.
References StrToInt(), and toStrVector().
Referenced by NumeReWindow::prepareSession().
std::string toLowerCase | ( | const std::string & | sUpperCase | ) |
Converts uppercase to lowercase letters.
sUpperCase | const std::string& |
Definition at line 896 of file stringtools.cpp.
Referenced by ProcedureVarFactory::checkSymbolName(), StringColumn::compare(), CategoricalColumn::compare(), NumeRe::Cluster::compare(), StringInternalMemory::compare(), StringColumn::convert(), CategoricalColumn::convert(), convertBaseToDecimal(), Archive::detectType(), doc_Help(), NumeReWindow::EvaluateCommandLine(), NumeRe::DataBase::find(), findParameter(), NumeReSyntax::getAutoCompList(), NumeReSyntax::getAutoCompListCPP(), NumeReSyntax::getAutoCompListMATLAB(), NumeReSyntax::getAutoCompListTeX(), NumeRe::getFileByType(), PackageDialog::getPackageIdentifier(), NumeReSyntax::getProcAutoCompList(), GenericTerminal::getProcNameSpace(), isConvertible(), listDirectory(), listFiles(), NumeReEditor::OnChangeCase(), NumeReWindow::OnFindEvent(), ProcedureViewerCompare(), FileSystem::resolveWildCards(), PlotData::setParams(), NumeReEditor::sortSelection(), strfnc_to_lowercase(), StrToCmplx(), StrToLogical(), GenericTerminal::tab(), and FileSystem::ValidFileName().
std::string toString | ( | __time64_t | tTime, |
int | timeStampFlags | ||
) |
Converts a time_t to a string. Will actually print a timestamp.
tTime | __time64_t |
timeStampFlags | int |
Definition at line 150 of file stringtools.cpp.
References _lang, Language::get(), GET_AS_TIMESTAMP, GET_ONLY_TIME, GET_WITH_TEXT, and getCurrentTimeZone().
std::string toString | ( | bool | bBoolean | ) |
Converts a boolean to a string by actually converting the numerical value to "true"
and "false"
.
bBoolean | bool |
Definition at line 291 of file stringtools.cpp.
std::string toString | ( | const std::complex< double > & | dNumber, |
int | nPrecision | ||
) |
Converts a complex number into a printable string.
dNumber | const std::complex<double>& |
nPrecision | int |
Definition at line 90 of file stringtools.cpp.
References mu::isinf(), mu::isnan(), and mu::rint().
std::string toString | ( | double | dNumber, |
const Settings & | _option | ||
) |
Converts a double to a string using the precision from the Settings object.
dNumber | double |
_option | const Settings& |
Definition at line 58 of file stringtools.cpp.
References Settings::getPrecision(), and toString().
std::string toString | ( | double | dNumber, |
int | nPrecision | ||
) |
Converts a double to a string using the passed precision.
dNumber | double |
nPrecision | int |
Definition at line 73 of file stringtools.cpp.
std::string toString | ( | int | nNumber | ) |
Converts an integer to a string without the Settings bloat.
nNumber | int |
Definition at line 121 of file stringtools.cpp.
References toString().
Referenced by CodeAnalyzer::analyseCommands(), analyzePulse(), append_data(), NumeRe::StringFuncHandler::applySpecialStringFuncs(), mu::ParserByteCode::AsciiDump(), calculate2dFFT(), calculateChiMap(), calculateSplines(), cartToCyl(), cartToPolar(), Procedure::catchExceptionForTest(), NumeReWindow::CloseAllFiles(), cmd_delete(), cmd_get(), cmd_load(), cmd_set(), cmd_show(), cmd_warn(), constructCovarianceMatrix(), ValueColumn::convert(), DateTimeColumn::convert(), convertToString(), FunctionDefinition::convertToValues(), Plot::CoordFunc(), coordsToGrid(), Plot::create2dPlot(), createDatagrid(), FileRevisions::createDiff(), DependencyDialog::CreateDotFile(), CellValueShaderDialog::createIntervalExclPage(), CellValueShaderDialog::createIntervalPage(), ProcedureVarFactory::createLocalInlineStrings(), ProcedureVarFactory::createLocalInlineVars(), ProcedureVarFactory::createMangledArgName(), ProcedureVarFactory::createMangledVarName(), FileRevisions::createNewRevision(), FileRevisions::createNewTag(), createOutputForHist1D(), createOutputForHist2D(), Plot::createPlotOrAnimation(), createStatsFile(), createStatsOutput(), NumeRe::StringVarFactory::createStringVectorVar(), NumeRe::ClusterManager::createTemporaryCluster(), NumeRe::StringVarFactory::createTempStringVectorVar(), NumeRe::StringParser::createTerminalOutput(), createTeXExport(), cylToCart(), cylToPolar(), NumeReDebugger::decodeType(), determineWindowSize(), doc_SearchFct(), CombinedCellEditor::EndEdit(), NumeReEditor::Entry(), mu::ParserBase::Eval(), evalMatOp(), NumeRe::StringLogicParser::evalStringLogic(), evaluateExpression(), evaluateParameterValues(), ProcedureVarFactory::evaluateProcedureArguments(), NumeReKernel::evaluateProcedureCalls(), NumeRe::StringParser::evaluateStack(), NumeRe::StringVarFactory::evaluateStringVectors(), Procedure::execute(), Plot::expandStyleForCurveArray(), NumeReEditor::ExtractAsHTML(), fastFourierTransform(), RenameSymbolsDialog::fillChangesLog(), findExtrema(), SearchController::FindProceduresInCurrentFile(), FlowCtrl::for_loop(), Output::format(), formatByteSize(), formatMatrixRow(), NumeRe::LaTeXTable::formatNumber(), formatNumberToTex(), NumeReKernel::formatResultOutput(), NumeReEditor::generateAutoCompList(), generateTemplate(), Language::get(), NumeReSyntax::getAutoCompList(), NumeReSyntax::getAutoCompListCPP(), NumeReSyntax::getAutoCompListMATLAB(), NumeReSyntax::getAutoCompListTeX(), Memory::getCategoryList(), GridNumeReTable::GetColLabelValue(), getDataForFit(), NumeRe::StringParser::getDataForString(), TableColumn::getDefaultColumnHead(), getErrorType(), getFileInfo(), Fitcontroller::getFitFunction(), getFitOptionsTable(), NumeReDebugger::getGlobals(), Documentation::getHelpArticle(), NumeRe::ClusterDoubleItem::getInternalString(), NumeReDebugger::getModuleInformations(), NumeReSyntax::getNameSpaceAutoCompList(), mu::ParserBase::getNextVectorVarIndex(), NumeReDebugger::getNumVars(), getParameterTable(), PlotData::getParams(), NumeReSyntax::getProcAutoCompList(), StringVector::getRef(), FileRevisions::getRevision(), GridNumeReTable::GetRowLabelValue(), NumeRe::Cluster::getShortVectorRepresentation(), NumeReDebugger::getStackTrace(), NumeRe::ClusterDoubleItem::getString(), NumeReKernel::getStringTable(), EditorNotebook::GetTabFromPoint(), DateTimeColumn::getValueAsInternalString(), ValueColumn::getValueAsString(), CategoricalColumn::getValueAsString(), NumeReKernel::getVariableList(), getVarList(), NumeRe::NumeReDataFile::getVersionString(), NumeReWindow::gotoLine(), CustomWindow::handleEvent(), Script::handleInstallInformation(), integrate(), integrate2d(), listConstants(), listDeclaredVariables(), listDefinitions(), listDirectory(), FunctionDefinitionManager::load(), NumeReKernel::MainLoop(), make_stringmatrix(), matrixReshape(), moveOrCopyFiles(), Odesolver::odeFunction(), NumeReWindow::OnCalculateDependencies(), NumeReWindow::OnCreatePackage(), MyApp::OnExceptionInMainLoop(), NumeReWindow::OnFileEventTimer(), NumeReWindow::OnFindEvent(), EditorNotebook::OnTabRightClicked(), NumeRe::FileAdapter::openFile(), Matrix::operator()(), padWithZeros(), parseArg(), NumeRe::JcampDX::parseLine(), parser_declareDataMatrixValuesForIndices(), parser_declareMatrixReturnValuesForIndices(), mu::ParserBase::PauseLoopMode(), Plot::plotstd3d(), plugin_random(), polarToCart(), polarToCyl(), FlowCtrl::prepareLocalVarsAndReplace(), prepareTicksForHist1d(), Matrix::printDims(), NumeRe::StringFuncHandler::printValue(), mu::printVector(), ProcedureElement::ProcedureElement(), Procedure::procedureInterface(), NumeReKernel::progressBar(), StringVector::push_back(), DetachedLogger::push_line(), FlowCtrl::range_based_for_loop(), NumeRe::XLSXSpreadSheet::readFile(), NumeRe::IgorBinaryWave::readFile(), NumeRe::ZygoDat::readFile(), readImage(), NumeRe::JcampDX::readTable(), TextManager::renderLayout(), NumeReKernel::resetAfterError(), FileRevisions::restoreRevision(), CodeAnalyzer::run(), seekInAudioFile(), FlowCtrl::setCommand(), TableViewer::SetData(), NumeRe::ClusterStringItem::setDouble(), setParametersInWindow(), DuplicateCodeDialog::SetResult(), StringColumn::setValue(), CategoricalColumn::setValue(), shortTimeFourierAnalysis(), showMatrixResult(), Odesolver::solve(), solveLGSSymbolic(), NumeReEditor::sortSelection(), mu::ParserBase::StackDump(), Timer::Stop(), NumeRe::StringParser::storeStringResults(), strfnc_basetodec(), strfnc_cnt(), strfnc_findparam(), strfnc_findtoken(), strfnc_getmatchingparens(), strfnc_getversioninfo(), strfnc_num(), strfnc_regex(), strfnc_str_not_match(), strfnc_str_not_rmatch(), strfnc_strfnd(), strfnc_strlen(), strfnc_strmatch(), strfnc_strrfnd(), strfnc_strrmatch(), strfnc_sum(), strfnc_timeformat(), tableMethod_anova(), FileRevisions::tagRevision(), taylor(), NumeReDebugger::throwException(), SyntaxStyles::to_string(), VectorIndex::to_string(), FileRevisions::undoRevision(), TablePanel::update(), ProcedureViewer::updateProcedureList(), TableViewer::updateStatusBar(), VariableViewer::UpdateVariables(), urlExecute(), windowCommand(), DetachedLogger::write_system_information(), NumeRe::CommaSeparatedValues::writeFile(), NumeRe::LaTeXTable::writeFile(), and NumeRe::TextDataFile::writeTableContents().
std::string toString | ( | int | nNumber, |
const Settings & | _option | ||
) |
Converts an integer to a string.
nNumber | int |
_option | const Settings& |
Definition at line 43 of file stringtools.cpp.
References toString().
Referenced by getTimeStamp(), intToVersion(), toCmdString(), and toString().
std::string toString | ( | long long int | nNumber | ) |
Converts a long long int to a string.
nNumber | long longint |
Definition at line 274 of file stringtools.cpp.
std::string toString | ( | size_t | nNumber | ) |
Converts an unsigned integer to a string.
nNumber | size_t |
Definition at line 135 of file stringtools.cpp.
References toString().
std::string toString | ( | sys_time_point | tp, |
int | timeStampFlags | ||
) |
Converts a sys_time_point to a string.
tp | sys_time_point |
timeStampFlags | int |
Definition at line 210 of file stringtools.cpp.
References _lang, date::year_month_day::day(), Language::get(), GET_AS_TIMESTAMP, GET_FULL_PRECISION, GET_MILLISECONDS, GET_ONLY_TIME, GET_WITH_TEXT, getCurrentTimeZone(), getTimeStampFromTimePoint(), time_stamp::m_hours, time_stamp::m_microsecs, time_stamp::m_millisecs, time_stamp::m_minutes, time_stamp::m_seconds, time_stamp::m_ymd, date::year_month_day::month(), and date::year_month_day::year().
std::vector< std::string > toStrVector | ( | std::string | sString | ) |
This function converts a std::string into a std::vector, where the string shall be passed as "{x,y,z,...}".
sString | std::string |
Definition at line 356 of file stringtools.cpp.
References getNextArgument().
Referenced by CellValueShaderDialog::OnButtonClick(), and toIntVector().
std::string toSystemCodePage | ( | std::string | sOutput | ) |
Converts an internal to an external string. Does nothing currently.
sOutput | std::string |
Definition at line 1253 of file stringtools.cpp.
Referenced by autoSave(), cmd_credits(), cmd_define(), cmd_plotting(), cmd_set(), cmd_workpath(), createOutputForHist1D(), createOutputForHist2D(), createPlotForHist1D(), Plot::createPlotOrAnimation(), createPlotsForHist2D(), createStatsOutput(), Plot::createSubPlotSet(), Plot::displayMessage(), doc_SearchFct(), Script::evaluateInstallInformation(), fastFourierTransform(), fastWaveletTransform(), fitDataSet(), Output::format(), Script::getNextScriptCommandFromScript(), getPathForSetting(), listCommands(), listConstants(), listDeclaredVariables(), listDefinitions(), listInstalledPlugins(), listLogicalOperators(), listUnitConversions(), FunctionDefinitionManager::load(), NumeReKernel::MainLoop(), Plot::Plot(), Output::print(), NumeReKernel::printVersionInfo(), Script::returnCommand(), FunctionDefinitionManager::save(), Settings::save(), Odesolver::solve(), solveLGS(), splitIntoLines(), and Script::writeProcedure().
std::string toUpperCase | ( | const std::string & | sLowerCase | ) |
Converts lowercase letters to uppercase ones.
sLowerCase | const std::string& |
Definition at line 932 of file stringtools.cpp.
Referenced by analyzePulse(), applyCommandHeuristics(), applyFunctionHeuristics(), SearchController::CleanDocumentation(), NumeRe::CleanDocumentation(), cmd_get(), cmd_set(), createListDirectoryHeader(), createOutputForHist1D(), createOutputForHist2D(), createStatsOutput(), doc_HelpAsHTML(), doc_SearchFct(), NumeRe::XLSXSpreadSheet::evalIndices(), fitDataSet(), NumeReEditor::generateAutoCompList(), NumeRe::CallTipProvider::getCommand(), NumeRe::CallTipProvider::getConstant(), NumeRe::CallTipProvider::getFunction(), NumeReKernel::getFunctionLanguageStrings(), NumeRe::CallTipProvider::getMethod(), NumeRe::CallTipProvider::getOption(), NumeReKernel::getPluginLanguageStrings(), NumeRe::CallTipProvider::getPredef(), listCommands(), listConstants(), listDeclaredVariables(), listDefinitions(), listDirectory(), listFiles(), listFunctions(), listInstalledPlugins(), listLogicalOperators(), listUnitConversions(), NumeReKernel::MainLoop(), NumeReEditor::OnChangeCase(), NumeReEditor::OnMouseDwell(), NumeReWindow::OnTreeItemToolTip(), NumeReWindow::prepareFunctionTree(), NumeRe::JcampDX::readTable(), sectionHeadline(), EditorNotebook::SetTabText(), show_data(), strfnc_to_uppercase(), NumeReWindow::UpdateStatusBar(), and Procedure::writeProcedure().
std::string truncString | ( | const std::string & | sText, |
size_t | nMaxChars | ||
) |
This function truncates the string to the passed max length (including a trailing ellipsis) or returns it unmodified, if it is shorter.
sText | const std::string& |
nMaxChars | size_t |
Definition at line 446 of file stringtools.cpp.
Referenced by NumeReKernel::formatResultOutput().
std::string utf8parser | ( | const std::string & | sString | ) |
Transforms a UTF8 encoded string into a standard ASCII string in the internal code page representation.
sString | const std::string& |
Definition at line 1307 of file stringtools.cpp.
Referenced by NumeRe::TextDataFile::decodeTableHeads(), NumeRe::CassyLabx::readFile(), NumeRe::CommaSeparatedValues::readFile(), NumeRe::OpenDocumentSpreadSheet::readFile(), NumeRe::XLSSpreadSheet::readFile(), and NumeRe::XLSXSpreadSheet::readFile().
size_t versionToInt | ( | std::string | sVersion | ) |
Converts a version string into a multi-digit integer.
sVersion | std::string |
Definition at line 795 of file stringtools.cpp.
References replaceAll(), StrToInt(), and sVersion.
Referenced by PackageRepoBrowser::DetectInstalledPackages(), Script::handleInstallInformation(), and incrementVersion().
std::string wcstombs | ( | const std::wstring & | wStr | ) |
This function is a wrapper for the usual wcstombs function, which can handle wstrings.
wStr | const std::wstring& |
Definition at line 1222 of file stringtools.cpp.
References wcstombs().
Referenced by YExcel::LargeString::ContinueRead(), YCompoundFiles::Block::Create(), YCompoundFiles::Block::Open(), YCompoundFiles::CompoundFile::PresentWorkingDirectory(), NumeRe::XLSSpreadSheet::readFile(), and wcstombs().