NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include "tools.hpp"
#include "../../kernel.hpp"
#include "../io/file.hpp"
#include <cstdlib>
#include <omp.h>
Go to the source code of this file.
Classes | |
class | ThreadsafeRandGen |
This class represents a thread safe random number generator (it is a container for multiple generator instances, each for every possible OMP thread). More... | |
Functions | |
std::mt19937 & | getRandGenInstance () |
Returns a reference to the central random number generator instance, which is globally accessible by all random number functions. More... | |
int | findParameter (const string &sCmd, const string &sParam, const char cFollowing) |
This function searches the passed parameter in the passed command string. If something is found, the position of the parameter+1 is returned. More... | |
bool | getStringArgument (const string &sCmd, string &sArgument) |
This function searches for the first string value in the passed expression and writes that into sArgument. If nothing was found, this function returns false, true otherwise. More... | |
string | extractStringToken (const string &sCmd, size_t nPos) |
This function extracts a string token at the selected position. If the position is start of an option value, the possible equal sign is ignored. More... | |
unsigned int | getMatchingParenthesis (const StringView &sLine) |
Returns the position of the closing parenthesis. More... | |
bool | isMultiValue (const string &sExpr, bool bIgnoreClosingParenthesis) |
Determines, if a string contains multiple comma-separated expressions. More... | |
static std::map< std::string, std::string > | getTeXCodePage () |
Static helper returning the TeX code page. More... | |
static std::map< std::string, std::string > | getTeXCodePageSpecial () |
static void | handleTeXIndicesAndExponents (std::string &sReturn, const std::map< std::string, std::string > &mCodePage) |
This function is a static helper function for the function replaceToTeX further down. More... | |
std::string | replaceToTeX (const std::string &sString, bool replaceForTeXFile) |
Replace the special tokens with their TeX counterparts, so that they can be handled by a LaTeX interpreter (like such in the plotting lib). More... | |
static Match | findCasualCommand (StringView sCmd) |
This is a static helper function for the findCommand function. More... | |
static bool | findShortestMatchForCommand (Match &_mMatch, size_t position, char character, StringView sCmd, const std::string &sCommand) |
This is a static helper function for the findCommandWithReturnValue function. More... | |
static Match | findCommandWithReturnValue (StringView sCmd, const string &sCommand) |
This is a static helper function for the findCommand function. More... | |
Match | findCommand (StringView sCmd, const std::string &sCommand) |
This function is very important for the command handler. More... | |
string | extractCommandString (const string &sCmd, const Match &_mMatch) |
Extracts the whole command string from a command line (which might contain more than one). More... | |
void | openExternally (const string &sFile) |
Opens a file with the program, which is associated by default within the Windows shell. More... | |
void | moveFile (const string &sFile, const string &sNewFileName) |
Move a file from one to another location. Can be used for renaming as well. More... | |
void | copyFile (const string &sFile, const string &sTarget) |
Copy the file's contents to another file. More... | |
void | writeTeXMain (const string &sTeXFile) |
static size_t | isStringContinuation (const std::string &sCmd, size_t pos) |
This static function detects, whether the current string expression is continued. More... | |
static void | parseArg (std::string &sArg, int flags) |
This static function is a helper for getArgAtPos to parse the expressions in the string. More... | |
string | getArgAtPos (const string &sCmd, unsigned int nPos, int extraction) |
Extracts a options value at the selected position and applies automatic parsing, if necessary. More... | |
bool | isInQuotes (StringView sExpr, unsigned int nPos, bool bIgnoreVarParser) |
Checks, whether the position in the passed expression is part of a string literal. More... | |
bool | isToStringArg (const string &sExpr, unsigned int nPos) |
This function determines, whether the current position is part of an argument of the three value to string conversion functions. More... | |
long long int | intCast (double number) |
Casts doubles to integers and avoids rounding errors. More... | |
long long int | intCast (const std::complex< double > &number) |
Casts the real part of the complex number to an integer and avoids rounding errors. More... | |
bool | isInt (const std::complex< double > &number) |
Determines, whether the content of a complex value is actually a regular integer. More... | |
bool | isDelimiter (char c) |
This function determines, if the passed character is a delimiter character. More... | |
bool | addLegends (string &sExpr) |
This function adds the missing legend strings to the expressions in the passed string. More... | |
bool | checkDelimiter (const string &sString, bool stringdelim) |
Checks, whether the first and the last character in the passed string is a delimiter character. More... | |
std::vector< std::string > | splitIntoLines (std::string sOutput, size_t lineWidth, bool bAllowDashBreaks, int nFirstIndent, int nIndent) |
This function splits a string into multiple lines if the line is longer than the desired line width. More... | |
std::string | outputString (std::vector< std::string > stringInLines, int nFirstIndent, int nIndent) |
This function outputs a string by adding the required prefixes and joining the various strings together. More... | |
std::string | LineBreak (std::string sOutput, const Settings &_option, bool bAllowDashBreaks, int nFirstIndent, int nIndent) |
This function takes a string, splits it into multiple lines if it is too long and returns the result. More... | |
double | Linearize (double x_0, double y_0, double x_1, double y_1) |
Determines the root of the line connecting the two passed points. More... | |
static StringView | getNextCommandLineToken (StringView &sArgList, char cSep) |
This function gets the first argument in the passed argument list if the boolean bCut is true then the argument is erased from the string. More... | |
string | getNextArgument (string &sArgList, bool bCut) |
string | getNextIndex (string &sArgList, bool bCut) |
string | getNextSemiColonSeparatedToken (string &sArgList, bool bCut) |
StringView | getNextViewedArgument (StringView &sView) |
StringView | getNextViewedIndex (StringView &sView) |
EndlessVector< StringView > | getAllArguments (StringView sArgList) |
Splits up the complete argument list and returns them as an EndlessVector. More... | |
EndlessVector< string > | getAllArguments (string sArgList) |
Splits up the complete argument list and returns them as an EndlessVector. More... | |
EndlessVector< string > | getAllIndices (string sArgList) |
Splits up the complete index list and returns them as an EndlessVector. More... | |
EndlessVector< string > | getAllSemiColonSeparatedTokens (string sArgList) |
Splits up the complete index list and returns them as an EndlessVector. More... | |
void | make_progressBar (int nStep, int nFirstStep, int nFinalStep, const string &sType) |
Wrapper for the static member function of the kernel. More... | |
static bool | containsStringClusters (const string &sLine) |
This function is a static helper function for containsStrings to search through the list of known clusters for string-containing clusters. More... | |
bool | containsStrings (const string &sLine) |
This function checks, whether the passed expression contains strings or valtostring parser. More... | |
bool | fileExists (const string &sFilename) |
This function checks, whether the file with the passed file name exists. More... | |
void | eraseToken (string &sExpr, const string &sToken, bool bTokenHasValue) |
This function erases option tokens including their possible value from a parameter string. More... | |
vector< string > | resolveChooseTokens (const string &sDirectory, const Settings &_option) |
This function resolves the possibility to select multiple paths at once by inserting something like this/is/a/<path|with|tokens>/which/will/search/at/different/locations. More... | |
static HANDLE | initializeFileHandle (string &sDir, WIN32_FIND_DATA *FindFileData, const Settings &_option) |
This function is a static helper function for getFileList and getFolderList. More... | |
vector< string > | getFileList (const string &sDirectory, const Settings &_option, int nFlags) |
This function returns a list of files (including their paths, if nFlags & 1). More... | |
vector< string > | getFolderList (const string &sDirectory, const Settings &_option, int nFlags) |
This function returns a list of directories (including their paths, if nFlags & 1). More... | |
void | reduceLogFilesize (const string &sFileName) |
This function is used to reduce the log file size from >= 100.000 to 20.000 lines to reduce the needed disk space. More... | |
static void | OprtRplc_setup (map< string, string > &mOprtRplc) |
This function is a variable initializer for the function replaceToVector name. It will only be called once. More... | |
string | replaceToVectorname (const string &sExpression) |
This function replaces a data access expression (i.e. the contents of the object argument parentheses) into a vector name, which is valid for the parser. More... | |
static bool | handleRecursiveOperators (string &sExpr, size_t &nPos, size_t &nArgSepPos) |
This function is a static helper function for evalRecursiveExpressions. More... | |
static void | handleIncAndDecOperators (string &sExpr, size_t nPos, size_t nArgSepPos) |
This function is a static helper function for evalRecursiveExpressions. More... | |
void | evalRecursiveExpressions (string &sExpr) |
This function converts the recursive assignments like VAR += VAL into VAR = VAR + (VAL) More... | |
string | getFileInfo (const string &sFileName) |
This function opens a NumeRe-Datafile file, reads its header and converts it to a human-readable string. More... | |
string | decodeNameSpace (string sCommandLine, const string &sThisNameSpace) |
bool | validateParenthesisNumber (const string &sCmd) |
This function is used to validate the number of parentheses, i.e. whether there's a closing parenthesis for each opened one. More... | |
void | addArgumentQuotes (string &sToAdd, const string &sParam) |
This function adds quotation marks around the value of the specified parameter. More... | |
void | addArgumentQuotes (string &sToAdd, size_t pos) |
This function adds quotation marks around the value of the specified parameter. More... | |
double | intPower (double dNumber, int nExponent) |
This function calculates the power of a value with the specialization that the exponent is an integer. More... | |
std::complex< double > | intPower (const std::complex< double > &dNumber, int nExponent) |
This function calculates the power of a value with the specialization that the exponent is an integer. Function overload for complex-valued bases. More... | |
bool | isToCmd (const string &sCmd, unsigned int nPos) |
This function evaluates, whether the desired position is part of the argument of a to_cmd() function. More... | |
unsigned int | countEscapeSymbols (const string &sLine) |
This function counts the number of escaped dollar signs. More... | |
static int | compareDouble (const void *p1, const void *p2) |
This is a static helper function for the standard qsort algorithm. More... | |
size_t | qSortDouble (double *dArray, size_t nlength) |
This is a wrapper for the standard qsort algorithm. It returns the number of valid elements and sorts the elements in-place. More... | |
static void | replaceSearchMethods (string &sLine, size_t nPos, size_t nFinalPos, const string &sReplacement, const string &sMethod, string &sArgument) |
This static function replaces all search-oriented methods in the current string variable access. More... | |
static void | replaceAccessMethods (string &sLine, size_t nPos, size_t nFinalPos, const string &sReplacement, const string &sMethod, string &sArgument) |
This static function replaces all access-oriented methods and the string splitter in the current string variable access. More... | |
void | replaceStringMethod (string &sLine, size_t nPos, size_t nLength, const string &sReplacement) |
This function searches the indicated string variable occurence for possible string methods and replaces them with the standard string function. More... | |
std::string | shortenFileName (const std::string &sFullFileName) |
This function will return a shortened version of the data file name, where each "/Path/" string part is transformed to "/../". More... | |
std::string | incrementVersion (std::string _sVer) |
Increments a MAJOR.MINOR.BUILD version string by one build count. More... | |
Variables | |
static ThreadsafeRandGen | randGenerator |
void addArgumentQuotes | ( | string & | sToAdd, |
const string & | sParam | ||
) |
This function adds quotation marks around the value of the specified parameter.
sToAdd | string& |
sParam | const string& |
Definition at line 3560 of file tools.cpp.
References addArgumentQuotes(), and findParameter().
Referenced by addArgumentQuotes(), cmd_define(), cmd_ifndefined(), cmd_redefine(), cmd_set(), cmd_stats(), and getPathForSetting().
void addArgumentQuotes | ( | string & | sToAdd, |
size_t | pos | ||
) |
This function adds quotation marks around the value of the specified parameter.
sToAdd | string& |
pos | size_t |
Definition at line 3580 of file tools.cpp.
References containsStrings(), and getArgAtPos().
bool addLegends | ( | string & | sExpr | ) |
This function adds the missing legend strings to the expressions in the passed string.
sExpr | string& |
Definition at line 1875 of file tools.cpp.
References getAllArguments(), getMatchingParenthesis(), StripSpaces(), SyntaxError::UNMATCHED_PARENTHESIS, and validateParenthesisNumber().
Referenced by Plot::createSubPlotSet().
bool checkDelimiter | ( | const string & | sString, |
bool | stringdelim | ||
) |
Checks, whether the first and the last character in the passed string is a delimiter character.
sString | const string& |
stringdelim | bool |
Definition at line 1982 of file tools.cpp.
References isDelimiter().
Referenced by FunctionDefinitionManager::call(), FunctionDefinition::convertToValues(), NumeRe::StringParser::eval(), findCommandWithReturnValue(), Fitcontroller::getFitFunction(), FunctionDefinition::replaceArgumentOccurences(), FlowCtrl::replaceLocalVars(), replaceToTeX(), ProcedureVarFactory::resolveArguments(), ProcedureVarFactory::resolveLocalClusters(), ProcedureVarFactory::resolveLocalStrings(), ProcedureVarFactory::resolveLocalTables(), ProcedureVarFactory::resolveLocalVars(), and splitIntoLines().
|
static |
This is a static helper function for the standard qsort algorithm.
p1 | const void* |
p2 | const void* |
Definition at line 3734 of file tools.cpp.
References mu::isnan().
Referenced by qSortDouble().
|
static |
This function is a static helper function for containsStrings to search through the list of known clusters for string-containing clusters.
sLine | const string& |
Definition at line 2442 of file tools.cpp.
References NumeRe::ClusterManager::getClusterMap(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), and isDelimiter().
Referenced by containsStrings().
bool containsStrings | ( | const string & | sLine | ) |
This function checks, whether the passed expression contains strings or valtostring parser.
sLine | const string& |
Definition at line 2470 of file tools.cpp.
References containsStringClusters().
Referenced by addArgumentQuotes(), cmd_install(), convertVectorToExpression(), NumeReDebugger::decodeType(), getStringArgument(), and taylor().
void copyFile | ( | const string & | sFile, |
const string & | sTarget | ||
) |
Copy the file's contents to another file.
sFile | const string& |
sTarget | const string& |
Definition at line 1431 of file tools.cpp.
References SyntaxError::CANNOT_OPEN_SOURCE, SyntaxError::CANNOT_OPEN_TARGET, and SyntaxError::invalid_position.
Referenced by moveFile(), and moveOrCopyFiles().
unsigned int countEscapeSymbols | ( | const string & | sLine | ) |
string decodeNameSpace | ( | string | sCommandLine, |
const string & | sThisNameSpace | ||
) |
Definition at line 3476 of file tools.cpp.
References StripSpaces().
Referenced by Procedure::execute(), SearchController::FindNameSpaceOfProcedure(), and Dependencies::getProcedureDependencies().
void eraseToken | ( | string & | sExpr, |
const string & | sToken, | ||
bool | bTokenHasValue | ||
) |
This function erases option tokens including their possible value from a parameter string.
sExpr | string& |
sToken | const string& |
bTokenHasValue | bool |
Definition at line 2527 of file tools.cpp.
References findParameter(), getMatchingParenthesis(), and isInQuotes().
Referenced by doc_Help(), and evaluateFittingParams().
void evalRecursiveExpressions | ( | string & | sExpr | ) |
This function converts the recursive assignments like VAR += VAL into VAR = VAR + (VAL)
sExpr | string& |
Definition at line 3346 of file tools.cpp.
References getMatchingParenthesis(), handleIncAndDecOperators(), and handleRecursiveOperators().
Referenced by FlowCtrl::calc(), FlowCtrl::compile(), FlowCtrl::fillJumpTableAndExpandRecursives(), NumeReKernel::MainLoop(), performMatrixOperation(), and Procedure::ProcCalc().
string extractCommandString | ( | const string & | sCmd, |
const Match & | _mMatch | ||
) |
Extracts the whole command string from a command line (which might contain more than one).
sCmd | const string& |
_mMatch | const Match& |
Definition at line 1325 of file tools.cpp.
References getMatchingParenthesis(), isInQuotes(), Match::nPos, and SyntaxError::UNMATCHED_PARENTHESIS.
Referenced by cmd_get(), CommandLineParser::CommandLineParser(), and PackageManager::evalPluginCmd().
string extractStringToken | ( | const string & | sCmd, |
size_t | nPos | ||
) |
This function extracts a string token at the selected position. If the position is start of an option value, the possible equal sign is ignored.
sCmd | const string& |
nPos | size_t |
Definition at line 310 of file tools.cpp.
References getMatchingParenthesis(), and isInQuotes().
Referenced by getStringArgument().
bool fileExists | ( | const string & | sFilename | ) |
This function checks, whether the file with the passed file name exists.
sFilename | const string& |
Definition at line 2500 of file tools.cpp.
References fromSystemCodePage().
Referenced by cmd_define(), cmd_load(), cmd_set(), NumeReWindow::compileLaTeX(), ProcedureLibrary::constructProcedureElement(), MemoryManager::deleteTable(), doc_SearchFct(), editObject(), NumeReEditor::FindAndOpenInclude(), NumeReEditor::FindAndOpenProcedure(), NumeRe::FindProcedureDefinition(), NumeReKernel::getGreeting(), Script::handleInstallInformation(), FileSystem::isFile(), NumeReHistory::loadHistory(), PackageDialog::loadProjectFile(), Language::loadStrings(), moveOrCopyFiles(), NumeReWindow::NumeReWindow(), NumeRe::FileAdapter::openFile(), Archive::pack(), prepareTemplate(), NumeReKernel::printVersionInfo(), NumeReWindow::runLaTeX(), NumeReKernel::StartUp(), strfnc_findfile(), strfnc_sha256(), Archive::unpack(), NumeReWindow::UpdateToolbar(), FileSystem::ValidFolderName(), and writeToFile().
|
static |
This is a static helper function for the findCommand function.
sCmd | StringView |
Definition at line 950 of file tools.cpp.
References StringViewBase::find_first_not_of(), isInQuotes(), StringViewBase::length(), Match::nPos, Match::sString, StringView::subview(), and StringViewBase::to_string().
Referenced by findCommand().
Match findCommand | ( | StringView | sCmd, |
const std::string & | sCommand | ||
) |
This function is very important for the command handler.
It extracts the command out of the complete command line. It is also capable of finding a command, which is not at the start of the line (i.e. commands, which are returning values).
sCmd | StringView |
sCommand | const std::string& |
Definition at line 1275 of file tools.cpp.
References StringViewBase::find(), findCasualCommand(), findCommand(), findCommandWithReturnValue(), Match::nPos, Match::sString, StripSpaces(), and StringViewBase::to_string().
Referenced by CodeAnalyzer::analyseCommands(), Procedure::applyInliningRuleset(), Assertion::assertionFail(), FlowCtrl::calc(), ProcedureVarFactory::checkArgument(), ProcedureVarFactory::checkArgumentValue(), FlowCtrl::checkParsingModeAndExpandDefinitions(), ProcedureElement::cleanCurrentLine(), cmd_clear(), cmd_get(), cmd_help(), cmd_install(), cmd_new(), cmd_plotting(), cmd_print(), cmd_redefine(), cmd_reload(), cmd_retouch(), cmd_stats(), cmd_undefine(), commandHandler(), CommandLineParser::CommandLineParser(), FlowCtrl::compile(), Plot::createSubPlotSet(), editObject(), PackageManager::evalPluginCmd(), NumeReKernel::evaluateProcedureCalls(), Plot::evaluateSubplot(), Procedure::execute(), FlowCtrl::fillJumpTableAndExpandRecursives(), findCommand(), findExtrema(), NumeRe::FindProcedureDefinition(), findShortestMatchForCommand(), fitDataSet(), FlowCtrl::for_loop(), Procedure::getInlined(), Includer::getNextLine(), Script::getNextScriptCommandFromScript(), Dependencies::getProcedureDependencies(), getVarList(), NumeReKernel::handleCommandLineSource(), NumeReKernel::handleComposeBlock(), Script::handleLocalDefinitions(), NumeReKernel::handleToCmd(), FlowCtrl::if_fork(), Includer::is_including_syntax(), Procedure::isInlineable(), PackageManager::isPluginCmd(), NumeReKernel::MainLoop(), Includer::openIncludedFile(), parseLayoutScript(), performMatrixOperation(), Plot::Plot(), plugin_histogram(), Procedure::ProcCalc(), Procedure::procedureCmdInterface(), ProcedureElement::ProcedureElement(), Procedure::procedureInterface(), FlowCtrl::range_based_for_loop(), Procedure::replaceReturnVal(), FlowCtrl::setCommand(), Odesolver::solve(), MemoryManager::sortElements(), FlowCtrl::switch_fork(), FlowCtrl::try_catch(), NumeReKernel::uninstallPlugin(), FlowCtrl::while_loop(), Script::writeProcedure(), and Procedure::writeProcedure().
|
static |
This is a static helper function for the findCommand function.
sCmd | StringView |
sCommand | const string& |
Definition at line 1103 of file tools.cpp.
References checkDelimiter(), StringViewBase::find(), findShortestMatchForCommand(), isInQuotes(), StringViewBase::length(), Match::nPos, Match::sString, StringView::subview(), and StringViewBase::to_string().
Referenced by findCommand().
int findParameter | ( | const string & | sCmd, |
const string & | sParam, | ||
const char | cFollowing | ||
) |
This function searches the passed parameter in the passed command string. If something is found, the position of the parameter+1 is returned.
sCmd | const string& |
sParam | const string& |
cFollowing | const char |
This function is one of the most important ones in the whole application as it provides the support for the defined command syntax.
Definition at line 113 of file tools.cpp.
References toLowerCase().
Referenced by addArgumentQuotes(), CodeAnalyzer::analyseCommands(), FunctionDefinition::appendComment(), FlowCtrl::calc(), cmd_close(), cmd_define(), cmd_get(), cmd_hline(), cmd_ifndefined(), cmd_load(), cmd_new(), cmd_quit(), cmd_redefine(), cmd_rename(), cmd_retouch(), cmd_save(), cmd_stats(), FlowCtrl::compile(), FunctionDefinition::convertToValues(), Plot::CoordSettings(), createHist1D(), createHist2D(), PackageManager::declareNewPackage(), FunctionDefinition::decodeDefinition(), NumeRe::StringParser::decodeStringParams(), FunctionDefinitionManager::defineFunc(), dialogCommand(), doc_Help(), editObject(), eraseToken(), evaluateFittingParams(), Script::evaluateInstallInformation(), evaluateParameterValues(), Plot::evaluateSubplot(), evaluateTargetOptionInCommand(), FlowCtrl::extractFlagsAndIndexVariables(), findExtrema(), findSettingOption(), findZeroes(), getEventProcedures(), CommandLineParser::getFileParameterValue(), getIntervalDef(), getItemId(), Package::getOptionValue(), getParametersFromWindow(), getParameterValue(), CommandLineParser::getParameterValue(), CommandLineParser::getParameterValueAsNumericalValue(), CommandLineParser::getParameterValueAsString(), getTagValue(), getTargetTable(), getVarList(), NumeReKernel::handleComposeBlock(), CommandLineParser::hasParam(), FunctionDefinition::importFunction(), IntervalSet::IntervalSet(), MemoryManager::matchTableAsParameter(), parseLayoutCommand(), parseLayoutScript(), Plot::Plot(), plugin_histogram(), plugin_random(), plugin_statistics(), ProcedureElement::ProcedureElement(), readAndParseIntervals(), readAndParseLegacyIntervals(), Settings::set(), setParametersInWindow(), PlotData::setParams(), Odesolver::solve(), MemoryManager::sortElements(), Memory::sortElements(), NumeRe::Cluster::sortElements(), StringInternalMemory::sortElements(), strfnc_findparam(), swapTables(), and windowCommand().
|
static |
This is a static helper function for the findCommandWithReturnValue function.
_mMatch | Match& |
position | size_t |
character | char |
sCmd | StringView |
sCommand | const std::string& |
Definition at line 1049 of file tools.cpp.
References StringViewBase::find(), findCommand(), isDelimiter(), isInQuotes(), StringViewBase::length(), Match::nPos, Match::sString, StringView::subview(), and StringViewBase::to_string().
Referenced by findCommandWithReturnValue().
EndlessVector< string > getAllArguments | ( | string | sArgList | ) |
Splits up the complete argument list and returns them as an EndlessVector.
sArgList | string |
Definition at line 2365 of file tools.cpp.
References getNextArgument().
EndlessVector< StringView > getAllArguments | ( | StringView | sArgList | ) |
Splits up the complete argument list and returns them as an EndlessVector.
sArgList | StringView |
Definition at line 2346 of file tools.cpp.
References getNextViewedArgument(), and StringViewBase::length().
Referenced by Documentation::addEntry(), addLegends(), CodeAnalyzer::analysePreDefs(), mu::ParserBase::compileVectorExpansion(), SymDefManager::createSymbol(), determineWindowSize(), Plot::fillData(), Documentation::findPositionUsingIdxKeys(), Documentation::getDocIndex(), Documentation::getHelpArticle(), getIndices(), handleMafDataAccess(), IntervalSet::IntervalSet(), FlowCtrl::range_based_for_loop(), readAndParseIntervals(), NumeRe::JcampDX::readFile(), readFromFile(), and PlotData::setParams().
EndlessVector< string > getAllIndices | ( | string | sArgList | ) |
Splits up the complete index list and returns them as an EndlessVector.
sArgList | string |
Definition at line 2384 of file tools.cpp.
References getNextIndex().
Referenced by Plot::createDataLegends(), evalPoints(), findExtrema(), findZeroes(), readAndParseIntervals(), readAndParseLegacyIntervals(), and Interval::refresh().
EndlessVector< string > getAllSemiColonSeparatedTokens | ( | string | sArgList | ) |
Splits up the complete index list and returns them as an EndlessVector.
sArgList | string |
Definition at line 2403 of file tools.cpp.
References getNextSemiColonSeparatedToken().
Referenced by cmd_reload(), Procedure::execute(), NumeReKernel::getLineFromCommandCache(), and NumeReSyntax::splitDefs().
string getArgAtPos | ( | const string & | sCmd, |
unsigned int | nPos, | ||
int | extraction | ||
) |
Extracts a options value at the selected position and applies automatic parsing, if necessary.
sCmd | const string& |
nPos | unsigned int |
extraction | int |
Definition at line 1598 of file tools.cpp.
References ARGEXTRACT_PARSED, ARGEXTRACT_STRIPPED, NumeReKernel::getInstance(), getMatchingParenthesis(), NumeReKernel::getStringParser(), isStringContinuation(), NumeRe::StringParser::isStringExpression(), parseArg(), and StripSpaces().
Referenced by addArgumentQuotes(), FunctionDefinition::appendComment(), FlowCtrl::calc(), cmd_list(), cmd_rename(), cmd_set(), FlowCtrl::compile(), FunctionDefinition::convertToValues(), PackageManager::declareNewPackage(), FunctionDefinition::decodeDefinition(), FunctionDefinitionManager::defineFunc(), dialogCommand(), evaluateFittingParams(), Script::evaluateInstallInformation(), Plot::evaluateSubplot(), evaluateTargetOptionInCommand(), NumeRe::OpenDocumentSpreadSheet::expandLine(), FlowCtrl::extractFlagsAndIndexVariables(), findExtrema(), findZeroes(), CommandLineParser::getFileParameterValue(), getIntervalDef(), getIntervalForSearchFunctions(), getItemId(), Package::getOptionValue(), getParametersFromWindow(), getParameterValue(), CommandLineParser::getParameterValue(), CommandLineParser::getParameterValueAsNumericalValue(), CommandLineParser::getParameterValueAsString(), getTagValue(), getTargetTable(), NumeReKernel::handleComposeBlock(), Script::handleInstallInformation(), FunctionDefinition::importFunction(), IntervalSet::IntervalSet(), listDirectory(), listFiles(), loadDocumentationArticle(), parseEventOpt(), MemoryManager::parseEvery(), parseLayoutCommand(), parseLayoutScript(), parseNumOpt(), parseStringOpt(), Plot::Plot(), plugin_histogram(), plugin_random(), plugin_statistics(), ProcedureElement::ProcedureElement(), readAndParseLegacyIntervals(), setParametersInWindow(), PlotData::setParams(), Odesolver::solve(), MemoryManager::sortElements(), Memory::sortElements(), StringInternalMemory::sortElements(), strfnc_getopt(), swapTables(), NumeReKernel::uninstallPlugin(), windowCommand(), and Script::writeLayout().
string getFileInfo | ( | const string & | sFileName | ) |
This function opens a NumeRe-Datafile file, reads its header and converts it to a human-readable string.
sFileName | const string& |
Definition at line 3446 of file tools.cpp.
References NumeRe::FileHeaderInfo::fileVersion, NumeRe::NumeReDataFile::getFileHeaderInformation(), NumeRe::FileHeaderInfo::nCols, NumeRe::FileHeaderInfo::nRows, NumeRe::NumeReDataFile::readFileInformation(), NumeRe::FileHeaderInfo::sComment, NumeRe::FileHeaderInfo::sTableName, NumeRe::FileHeaderInfo::timeStamp, and toString().
Referenced by NumeReWindow::getFileDetails(), and listDirectory().
vector< string > getFileList | ( | const string & | sDirectory, |
const Settings & | _option, | ||
int | nFlags | ||
) |
This function returns a list of files (including their paths, if nFlags & 1).
sDirectory | const string& |
_option | const Settings& |
nFlags | int |
Definition at line 2853 of file tools.cpp.
References initializeFileHandle(), replacePathSeparator(), and resolveChooseTokens().
Referenced by append_data(), cmd_load(), Documentation::createDocumentationIndex(), NumeReWindow::CreateProcedureTree(), moveOrCopyFiles(), Archive::pack(), removeFile(), and strfnc_getfilelist().
vector< string > getFolderList | ( | const string & | sDirectory, |
const Settings & | _option, | ||
int | nFlags | ||
) |
This function returns a list of directories (including their paths, if nFlags & 1).
sDirectory | const string& |
_option | const Settings& |
nFlags | int |
Definition at line 2925 of file tools.cpp.
References initializeFileHandle(), replacePathSeparator(), and resolveChooseTokens().
Referenced by NumeReWindow::CreateProcedureTree(), Archive::pack(), resolveChooseTokens(), and strfnc_getfolderlist().
unsigned int getMatchingParenthesis | ( | const StringView & | sLine | ) |
Returns the position of the closing parenthesis.
sLine | StringView |
This function determines the type of the desired parenthesis by itself by using the first parenthesis-like character that might be found in the passed string. This function also considers quotation marks, so that parentheses in strings are not considered as matching. If the function does not find the matching parenthesis, it returns string::npos
Definition at line 414 of file tools.cpp.
References StringViewBase::find_first_of(), and StringViewBase::length().
Referenced by addLegends(), applyValueHeuristics(), FlowCtrl::calc(), FunctionDefinitionManager::call(), FlowCtrl::checkFlowControlArgument(), cmd_stats(), FlowCtrl::compile(), mu::ParserBase::compileVectorExpansion(), mu::ParserBase::compileVectors(), mu::ParserBase::compileVectorsInMultiArgFunc(), containsFreeOperators(), convertVectorToExpression(), Plot::createDataLegends(), createEveryDefinition(), createMafVectorName(), NumeRe::StringParser::createStack(), Plot::createStd3dPlot(), FunctionDefinition::decodeDefinition(), differentiate(), doc_ReplaceExprContentForHTML(), eraseToken(), NumeRe::StringParser::eval(), evalMatOp(), evalRecursiveExpressions(), NumeRe::StringLogicParser::evalStringLogic(), evaluateFittingParams(), Sorter::evaluateKeyList(), NumeReKernel::evaluateProcedureCalls(), Procedure::expandInlineProcedures(), extractCommandString(), extractFirstParameterStringValue(), Procedure::extractProcedureInformation(), extractStringToken(), NumeRe::StringExpression::findAssignmentOperator(), mu::ParserBase::FindMultiArgFunc(), NumeRe::StringFuncHandler::findNextFunction(), NumeRe::FindProcedureDefinition(), SearchController::FindProcedureDefinitionInLocalFile(), Documentation::getArgAtPos(), getArgAtPos(), NumeReEditor::GetCurrentArgument(), getFittingParameters(), getIndices(), getIntervalForSearchFunctions(), getMafAccessString(), getNextCommandLineToken(), getPositionOfFirstDelimiter(), NumeRe::StringLogicParser::getStringTernaryExpression(), GenericTerminal::handle_calltip(), handleRecursiveOperators(), NumeReKernel::handleToCmd(), FunctionDefinition::importFunction(), integrate(), IntervalSet::IntervalSet(), isClusterCandidate(), isInQuotes(), isMultiValue(), NumeRe::StringVarFactory::isNumericCandidate(), isToCmd(), isToStringArg(), NumeRe::StringParser::numToString(), CommandLineParser::parse(), parseCmdArg(), Procedure::ProcCalc(), ProcedureElement::ProcedureElement(), Procedure::procedureInterface(), readAndParseIntervals(), NumeRe::realignLangString(), removeObsoleteParentheses(), replaceDataEntities(), replaceEntityOccurence(), replaceStringMethod(), replaceToTeX(), ProcedureVarFactory::resolveArguments(), Plot::separateFunctionsAndData(), FlowCtrl::setCommand(), FunctionDefinition::splitAndValidateArguments(), strfnc_getmatchingparens(), and Procedure::writeProcedure().
string getNextArgument | ( | 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(), getAllArguments(), NumeReEditor::GetCurrentArgument(), CommandLineParser::getParameterValueAsNumericalValue(), Script::handleInstallInformation(), Package::importDefinition(), newObject(), FunctionDefinition::parse(), NumeRe::StringParser::parseStringsInIndices(), FlowCtrl::prepareSwitchExpression(), replaceEntityOccurence(), replaceSearchMethods(), 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().
|
static |
This function gets the first argument in the passed argument list if the boolean bCut is true then the argument is erased from the string.
sArgList | StringView& |
cSep | char |
Definition at line 2242 of file tools.cpp.
References getMatchingParenthesis(), StringViewBase::length(), StringViewBase::strip(), StringView::subview(), and StringViewBase::trim_front().
Referenced by getNextArgument(), getNextIndex(), getNextSemiColonSeparatedToken(), getNextViewedArgument(), and getNextViewedIndex().
string getNextIndex | ( | string & | sArgList, |
bool | bCut | ||
) |
Definition at line 2305 of file tools.cpp.
References getNextCommandLineToken(), and StringViewBase::to_string().
Referenced by evaluateParameterValues(), and getAllIndices().
string getNextSemiColonSeparatedToken | ( | string & | sArgList, |
bool | bCut | ||
) |
Definition at line 2316 of file tools.cpp.
References getNextCommandLineToken(), and StringViewBase::to_string().
Referenced by getAllSemiColonSeparatedTokens().
StringView getNextViewedArgument | ( | StringView & | sView | ) |
Definition at line 2327 of file tools.cpp.
References getNextCommandLineToken().
Referenced by NumeRe::StringFuncHandler::argumentParser(), mu::ExpressionTarget::create(), extractIndexList(), and getAllArguments().
StringView getNextViewedIndex | ( | StringView & | sView | ) |
Definition at line 2332 of file tools.cpp.
References getNextCommandLineToken().
Referenced by extractIndexList().
std::mt19937 & getRandGenInstance | ( | ) |
Returns a reference to the central random number generator instance, which is globally accessible by all random number functions.
Definition at line 91 of file tools.cpp.
References ThreadsafeRandGen::getGenerator(), and randGenerator.
Referenced by createShuffledMatrix(), parser_gRandom(), and parser_Random().
bool getStringArgument | ( | const string & | sCmd, |
string & | sArgument | ||
) |
This function searches for the first string value in the passed expression and writes that into sArgument. If nothing was found, this function returns false, true otherwise.
sCmd | const string& |
sArgument | string& |
Definition at line 250 of file tools.cpp.
References containsStrings(), and extractStringToken().
Referenced by evaluateParameterValues(), extractFirstParameterStringValue(), and Procedure::ProcCalc().
|
static |
Static helper returning the TeX code page.
Definition at line 527 of file tools.cpp.
Referenced by replaceToTeX().
|
static |
Definition at line 633 of file tools.cpp.
Referenced by replaceToTeX().
|
static |
This function is a static helper function for evalRecursiveExpressions.
sExpr | string& |
nPos | size_t |
nArgSepPos | size_t |
Definition at line 3314 of file tools.cpp.
Referenced by evalRecursiveExpressions().
|
static |
This function is a static helper function for evalRecursiveExpressions.
sExpr | string& |
nPos | size_t& |
nArgSepPos | size_t& |
Definition at line 3146 of file tools.cpp.
References getMatchingParenthesis().
Referenced by evalRecursiveExpressions().
|
static |
This function is a static helper function for the function replaceToTeX further down.
sReturn | std::string& |
std::map<std::string | const |
mCodePage | std::string>& |
Definition at line 661 of file tools.cpp.
Referenced by replaceToTeX().
std::string incrementVersion | ( | std::string | _sVer | ) |
Increments a MAJOR.MINOR.BUILD version string by one build count.
_sVer | std::string |
Definition at line 3991 of file tools.cpp.
References intToVersion(), and versionToInt().
Referenced by PackageDialog::loadProjectFile().
|
static |
This function is a static helper function for getFileList and getFolderList.
sDir | string& |
FindFileData | WIN32_FIND_DATA* |
_option | const Settings& |
Definition at line 2789 of file tools.cpp.
References Settings::getExePath(), Settings::getLoadPath(), Settings::getPlotPath(), Settings::getProcPath(), Settings::getSavePath(), Settings::getScriptPath(), Settings::getWorkPath(), and replacePathSeparator().
Referenced by getFileList(), and getFolderList().
long long int intCast | ( | const std::complex< double > & | number | ) |
Casts the real part of the complex number to an integer and avoids rounding errors.
number | const std::complex<double>& |
Definition at line 1824 of file tools.cpp.
References intCast().
Referenced by mu::ParserByteCode::AddOp(), append_data(), NumeRe::StringFuncHandler::applySpecialStringFuncs(), NumeRe::StringFuncHandler::argumentParser(), assemble(), bilinearInterpolation(), FlowCtrl::calc(), cmd_load(), cmd_progress(), cmd_resample(), cmd_smooth(), Memory::cmp(), NumeRe::Cluster::cmp(), FlowCtrl::compile(), Plot::constructDataLegendElement(), createDatagrid(), Plot::createDataLegends(), differentiate(), doc_SearchFct(), evalMatOp(), evalPoints(), Plot::evaluateSubplot(), FlowCtrl::extractFlagsAndIndexVariables(), fastWaveletTransform(), findExtrema(), findZeroes(), FlowCtrl::for_loop(), getIndices(), getWindow(), handleCasualIndices(), handleIndexVectors(), integrate(), integrate2d(), interpolateToGrid(), Memory::maxpos(), Memory::minpos(), parseCmdArg(), MemoryManager::parseEvery(), parser_AssociatedLaguerrePolynomial(), parser_AssociatedLegendrePolynomial(), parser_beta(), parser_BetheWeizsaecker(), parser_BinAND(), parser_Binom(), parser_BinOR(), parser_compare(), parser_digamma(), parser_doubleFaculty(), parser_Faculty(), parser_gcd(), parser_HermitePolynomial(), parser_imSphericalHarmonics(), parser_IrregularCylBessel(), parser_LaguerrePolynomial(), parser_lcm(), parser_LegendrePolynomial(), parser_perlin(), parser_polygamma(), parser_RegularCylBessel(), parser_round(), parser_sleep(), parser_SphericalBessel(), parser_SphericalHarmonics(), parser_SphericalNeumann(), parser_studentFactor(), parser_Zernike(), particleSwarmOptimizer(), Plot::Plot(), plugin_histogram(), plugin_random(), NumeRe::StringFuncHandler::printValue(), NumeReKernel::progressBar(), FlowCtrl::range_based_for_loop(), Memory::readMemInterpolated(), regularizeDataSet(), replaceEntityOccurence(), saveDataObject(), selection(), PlotData::setParams(), CategoricalColumn::setValue(), shortTimeFourierAnalysis(), Odesolver::solve(), tableMethod_anova(), tableMethod_binsof(), tableMethod_cov(), tableMethod_index(), tableMethod_pcorr(), tableMethod_rank(), tableMethod_scorr(), tableMethod_typeof(), tableMethod_zscore(), taylor(), VectorIndex::VectorIndex(), and writeAudioFile().
long long int intCast | ( | double | number | ) |
Casts doubles to integers and avoids rounding errors.
number | double |
Definition at line 1805 of file tools.cpp.
References mu::rint().
Referenced by intCast(), and parseArg().
std::complex< double > intPower | ( | const std::complex< double > & | dNumber, |
int | nExponent | ||
) |
This function calculates the power of a value with the specialization that the exponent is an integer. Function overload for complex-valued bases.
dNumber | const std::complex<double>& |
nExponent | int |
Definition at line 3640 of file tools.cpp.
References date::abs(), and intPower().
Referenced by applyNiceAxis(), calcStats(), cartToCyl(), cartToPolar(), complex_zeta(), convertBaseToDecimal(), cylToPolar(), mu::Parser::Diff(), differentiate(), Memory::getOneWayAnova(), mu::ParserBase::ParseCmdCodeBulk(), mu::ParserBase::ParseCmdCodeBulkParallel(), parser_AssociatedLaguerrePolynomial(), parser_AssociatedLegendrePolynomial(), parser_LaguerrePolynomial(), parser_LegendrePolynomial(), parser_polynomial(), parser_round(), parser_SphericalBessel(), parser_SphericalNeumann(), parser_ZernikeRadial(), and mu::MathImpl< T >::Pow().
double intPower | ( | double | dNumber, |
int | nExponent | ||
) |
This function calculates the power of a value with the specialization that the exponent is an integer.
Calculates the power of a number using an integer as exponent.
dNumber | double |
nExponent | int |
Definition at line 3607 of file tools.cpp.
References date::abs().
Referenced by intPower(), and StrToTime().
bool isDelimiter | ( | char | c | ) |
This function determines, if the passed character is a delimiter character.
c | char |
Definition at line 1852 of file tools.cpp.
Referenced by checkDelimiter(), cmd_remove(), mu::ParserBase::compileVectors(), containsStringClusters(), evalMatOp(), NumeRe::StringVarFactory::evaluateStringVectors(), NumeRe::StringFuncHandler::findNextFunction(), findShortestMatchForCommand(), getMafFromAccessString(), NumeRe::StringParser::isStringExpression(), NumeRe::StringParser::isToken(), isToStringArg(), replaceDataEntities(), and replaceToTeX().
bool isInQuotes | ( | StringView | sExpr, |
unsigned int | nPos, | ||
bool | bIgnoreVarParser | ||
) |
Checks, whether the position in the passed expression is part of a string literal.
sExpr | StringView |
nPos | unsigned int |
bool | bIgnoreVarParser = false |
Definition at line 1672 of file tools.cpp.
References getMatchingParenthesis(), isInQuotes(), StringViewBase::length(), StringViewBase::rfind(), and StringView::subview().
Referenced by FlowCtrl::calc(), FunctionDefinitionManager::call(), FlowCtrl::compile(), CodeAnalyzer::containsAssignment(), Procedure::countProceduresInLine(), ProcedureVarFactory::countVarListElements(), Plot::create2dDrawing(), Plot::create3dDrawing(), Plot::createSubPlotSet(), eraseToken(), NumeRe::StringLogicParser::evalStringLogic(), NumeRe::StringLogicParser::evalStringTernary(), evaluateParameterValues(), NumeReKernel::evaluateProcedureCalls(), NumeRe::StringVarFactory::evaluateStringVectors(), Procedure::expandInlineProcedures(), extractCommandString(), extractStringToken(), findCasualCommand(), findCommandWithReturnValue(), NumeRe::StringFuncHandler::findNextFunction(), findShortestMatchForCommand(), findVariableInExpression(), CommandLineParser::getAllParametersWithValues(), NumeRe::StringVarFactory::getStringValues(), NumeRe::StringVarFactory::getStringValuesAsInternalVar(), handleMafDataAccess(), NumeReKernel::handleToCmd(), IntervalSet::IntervalSet(), Procedure::isInline(), isInQuotes(), isToCmd(), NumeRe::StringParser::numToString(), Plot::Plot(), Procedure::ProcCalc(), Procedure::procedureInterface(), readAndParseIntervals(), replaceDataEntities(), FlowCtrl::replaceLocalVars(), ProcedureVarFactory::resolveArguments(), ProcedureVarFactory::resolveLocalClusters(), ProcedureVarFactory::resolveLocalStrings(), ProcedureVarFactory::resolveLocalTables(), ProcedureVarFactory::resolveLocalVars(), Dependencies::resolveProcedureCalls(), PlotData::setParams(), and Procedure::writeProcedure().
bool isInt | ( | const std::complex< double > & | number | ) |
Determines, whether the content of a complex value is actually a regular integer.
number | const std::complex<double>& |
Definition at line 1838 of file tools.cpp.
References mu::rint().
Referenced by CategoricalColumn::setValue().
bool isMultiValue | ( | const string & | sExpr, |
bool | bIgnoreClosingParenthesis | ||
) |
Determines, if a string contains multiple comma-separated expressions.
sExpr | const string& |
bIgnoreClosingParenthesis | bool |
Definition at line 484 of file tools.cpp.
References getMatchingParenthesis(), and isMultiValue().
Referenced by convertVectorToExpression(), FunctionDefinition::decodeDefinition(), Procedure::getInlined(), and isMultiValue().
|
static |
This static function detects, whether the current string expression is continued.
sCmd | const std::string& |
pos | size_t |
Definition at line 1504 of file tools.cpp.
Referenced by getArgAtPos().
bool isToCmd | ( | const string & | sCmd, |
unsigned int | nPos | ||
) |
This function evaluates, whether the desired position is part of the argument of a to_cmd() function.
Checks, whether the "to_cmd()" function was used.
sCmd | const string& |
nPos | unsigned int |
Definition at line 3675 of file tools.cpp.
References getMatchingParenthesis(), and isInQuotes().
Referenced by ProcedureVarFactory::resolveArguments(), ProcedureVarFactory::resolveLocalClusters(), ProcedureVarFactory::resolveLocalStrings(), ProcedureVarFactory::resolveLocalTables(), and ProcedureVarFactory::resolveLocalVars().
bool isToStringArg | ( | const string & | sExpr, |
unsigned int | nPos | ||
) |
This function determines, whether the current position is part of an argument of the three value to string conversion functions.
sExpr | const string& |
nPos | unsigned int |
Definition at line 1766 of file tools.cpp.
References getMatchingParenthesis(), and isDelimiter().
Referenced by convertVectorToExpression().
double Linearize | ( | double | x_0, |
double | y_0, | ||
double | x_1, | ||
double | y_1 | ||
) |
Determines the root of the line connecting the two passed points.
x_0 | double |
y_0 | double |
x_1 | double |
y_1 | double |
Definition at line 2222 of file tools.cpp.
Referenced by findZeroesInMultiResult(), localizeExtremum(), and localizeZero().
std::string LineBreak | ( | std::string | sOutput, |
const Settings & | _option, | ||
bool | bAllowDashBreaks, | ||
int | nFirstIndent, | ||
int | nIndent | ||
) |
This function takes a string, splits it into multiple lines if it is too long and returns the result.
sOutput | std::string |
_option | const Settings& |
bAllowDashBreaks | bool |
nFirstIndent | int |
nIndent | int |
Definition at line 2205 of file tools.cpp.
References Settings::getWindow(), outputString(), and splitIntoLines().
Referenced by MemoryManager::addTable(), append_data(), calculateChiMap(), clear_cache(), cmd_find(), cmd_get(), cmd_move(), cmd_readline(), cmd_rename(), cmd_resample(), cmd_retouch(), cmd_set(), createPlotForHist1D(), createPlotsForHist2D(), doc_Help(), NumeReKernel::evaluateStrings(), fastFourierTransform(), fastWaveletTransform(), fitDataSet(), Output::format(), NumeReKernel::handleComposeBlock(), NumeReKernel::handleFlowControls(), Script::handleInstallInformation(), NumeReKernel::handleProcedureWrite(), listCommands(), listConstants(), listDefinitions(), listFiles(), listFunctions(), listLogicalOperators(), listUnitConversions(), FunctionDefinitionManager::load(), load_data(), NumeReKernel::MainLoop(), Plot::Plot(), NumeReKernel::printVersionInfo(), removeFile(), NumeReKernel::resetAfterError(), NumeReKernel::saveData(), swapTables(), taylor(), and NumeReKernel::uninstallPlugin().
void make_progressBar | ( | int | nStep, |
int | nFirstStep, | ||
int | nFinalStep, | ||
const string & | sType | ||
) |
Wrapper for the static member function of the kernel.
nStep | int |
nFirstStep | int |
nFinalStep | int |
sType | const string& |
Definition at line 2425 of file tools.cpp.
References NumeReKernel::progressBar().
Referenced by FlowCtrl::calc(), cmd_progress(), and FlowCtrl::compile().
void moveFile | ( | const string & | sFile, |
const string & | sNewFileName | ||
) |
Move a file from one to another location. Can be used for renaming as well.
sFile | const string& |
sNewFileName | const string& |
Definition at line 1412 of file tools.cpp.
References copyFile().
Referenced by moveOrCopyFiles().
void openExternally | ( | const string & | sFile | ) |
Opens a file with the program, which is associated by default within the Windows shell.
sFile | const string& |
Definition at line 1375 of file tools.cpp.
References SyntaxError::CANNOT_READ_FILE, SyntaxError::EXTERNAL_PROGRAM_NOT_FOUND, SyntaxError::invalid_position, and replaceAll().
Referenced by editObject().
|
static |
This function is a variable initializer for the function replaceToVector name. It will only be called once.
map<string | |
mOprtRplc | string>& |
Definition at line 3073 of file tools.cpp.
Referenced by replaceToVectorname().
std::string outputString | ( | std::vector< std::string > | stringInLines, |
int | nFirstIndent, | ||
int | nIndent | ||
) |
This function outputs a string by adding the required prefixes and joining the various strings together.
stringInLines | std::vector<std::string> |
nFirstIndent | int |
nIndent | int |
Definition at line 2164 of file tools.cpp.
Referenced by LineBreak().
|
static |
This static function is a helper for getArgAtPos to parse the expressions in the string.
sArg | std::string& |
flags | int |
Definition at line 1538 of file tools.cpp.
References ARGEXTRACT_ASINT, ARGEXTRACT_ASSTRING, FunctionDefinitionManager::call(), MemoryManager::containsTablesOrClusters(), mu::ParserBase::Eval(), NumeRe::StringParser::evalAndFormat(), SyntaxError::FUNCTION_ERROR, getDataElements(), NumeReKernel::getDefinitions(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), NumeReKernel::getParser(), Settings::getPrecision(), NumeReKernel::getSettings(), NumeReKernel::getStringParser(), intCast(), NumeRe::StringParser::isStringExpression(), mu::ParserBase::SetExpr(), NumeRe::StringParser::STRING_SUCCESS, and toString().
Referenced by getArgAtPos().
size_t qSortDouble | ( | double * | dArray, |
size_t | nlength | ||
) |
This is a wrapper for the standard qsort algorithm. It returns the number of valid elements and sorts the elements in-place.
dArray | double* |
nlength | size_t |
Definition at line 3762 of file tools.cpp.
References compareDouble(), mu::isinf(), and mu::isnan().
Referenced by PlotAsset::getWeightedRanges(), NumeRe::Cluster::med(), Memory::med(), Memory::pct(), and NumeRe::Cluster::pct().
void reduceLogFilesize | ( | const string & | sFileName | ) |
This function is used to reduce the log file size from >= 100.000 to 20.000 lines to reduce the needed disk space.
sFileName | const string& |
Definition at line 2998 of file tools.cpp.
References date::detail::trunc().
Referenced by fitDataSet(), and NumeReKernel::StartUp().
|
static |
This static function replaces all access-oriented methods and the string splitter in the current string variable access.
sLine | string& |
nPos | size_t |
nFinalPos | size_t |
sReplacement | const string& |
sMethod | const string& |
sArgument | string& |
Definition at line 3843 of file tools.cpp.
Referenced by replaceStringMethod().
|
static |
This static function replaces all search-oriented methods in the current string variable access.
sLine | string& |
nPos | size_t |
nFinalPos | size_t |
sReplacement | const string& |
sMethod | const string& |
sArgument | string& |
Definition at line 3791 of file tools.cpp.
References getNextArgument().
Referenced by replaceStringMethod().
void replaceStringMethod | ( | string & | sLine, |
size_t | nPos, | ||
size_t | nLength, | ||
const string & | sReplacement | ||
) |
This function searches the indicated string variable occurence for possible string methods and replaces them with the standard string function.
sLine | string& |
nPos | size_t |
nLength | size_t |
sReplacement | const string& |
Definition at line 3875 of file tools.cpp.
References getMatchingParenthesis(), replaceAccessMethods(), and replaceSearchMethods().
Referenced by NumeRe::StringVarFactory::getStringValues(), NumeRe::StringVarFactory::getStringValuesAsInternalVar(), and ProcedureVarFactory::resolveLocalStrings().
std::string replaceToTeX | ( | const std::string & | sString, |
bool | replaceForTeXFile | ||
) |
Replace the special tokens with their TeX counterparts, so that they can be handled by a LaTeX interpreter (like such in the plotting lib).
sString | const std::string& |
replaceForTeXFile | bool true for TeX files. Will replace fewer characters. |
Definition at line 753 of file tools.cpp.
References checkDelimiter(), getMatchingParenthesis(), getTeXCodePage(), getTeXCodePageSpecial(), handleTeXIndicesAndExponents(), isDelimiter(), and StripSpaces().
Referenced by calculateHist1dData(), Plot::create2dPlot(), Plot::createStd3dPlot(), Plot::createStdPlot(), createTeXExport(), and PlotData::getAxisLabel().
string replaceToVectorname | ( | const string & | sExpression | ) |
This function replaces a data access expression (i.e. the contents of the object argument parentheses) into a vector name, which is valid for the parser.
sExpression | const string& |
Definition at line 3108 of file tools.cpp.
References OprtRplc_setup().
Referenced by NumeRe::StringFuncHandler::applySpecialStringFuncs(), createMafVectorName(), and replaceDataEntities().
vector< string > resolveChooseTokens | ( | const string & | sDirectory, |
const Settings & | _option | ||
) |
This function resolves the possibility to select multiple paths at once by inserting something like this/is/a/<path|with|tokens>/which/will/search/at/different/locations.
sDirectory | const string& |
_option | const Settings& |
Definition at line 2584 of file tools.cpp.
References getFolderList().
Referenced by getFileList(), and getFolderList().
std::string shortenFileName | ( | const std::string & | sFullFileName | ) |
This function will return a shortened version of the data file name, where each "/Path/" string part is transformed to "/../".
sFullFileName | const std::string& |
Definition at line 3953 of file tools.cpp.
References replacePathSeparator().
Referenced by NumeRe::FileAdapter::getDataFileNameShort(), and EditorNotebook::SetTabText().
std::vector< std::string > splitIntoLines | ( | std::string | sOutput, |
size_t | lineWidth, | ||
bool | bAllowDashBreaks, | ||
int | nFirstIndent, | ||
int | nIndent | ||
) |
This function splits a string into multiple lines if the line is longer than the desired line width.
sOutput | std::string |
lineWidth | size_t |
bAllowDashBreaks | bool |
nFirstIndent | int |
nIndent | int |
Definition at line 2002 of file tools.cpp.
References checkDelimiter(), and toSystemCodePage().
Referenced by LineBreak(), and plotTableBySize().
bool validateParenthesisNumber | ( | const string & | sCmd | ) |
This function is used to validate the number of parentheses, i.e. whether there's a closing parenthesis for each opened one.
Checks, whether the number of parentheses is an even number.
sCmd | const string& |
Definition at line 3512 of file tools.cpp.
Referenced by addLegends(), applyValueHeuristics(), ProcedureVarFactory::createProcedureArguments(), getDataElements(), NumeReKernel::handleCommandLineSource(), ProcedureElement::ProcedureElement(), and FlowCtrl::setCommand().
void writeTeXMain | ( | const string & | sTeXFile | ) |
Definition at line 1449 of file tools.cpp.
References SyntaxError::CANNOT_OPEN_TARGET, and SyntaxError::invalid_position.
Referenced by Plot::Plot().
|
static |
File static random number generator, which will be usable via the scoped getRandGenInstance function, which will return a reference to this random number generator
Definition at line 79 of file tools.cpp.
Referenced by getRandGenInstance().