NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
dataops.hpp File Reference
#include <string>
#include "memorymanager.hpp"
#include "../settings.hpp"
#include "../commandlineparser.hpp"
#include "../ParserLib/muParser.h"
#include "../io/output.hpp"
#include "../maths/define.hpp"
Include dependency graph for dataops.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void load_data (MemoryManager &_data, Settings &_option, mu::Parser &_parser, std::string sFileName="")
 This function is a wrapper for the Datafile object. It will simply do the whole UI stuff and let the Datafile object do the hard work. More...
 
void show_data (MemoryManager &_data, Output &_out, Settings &_option, const std::string &_sCache, size_t nPrecision)
 This function presents the passed data to the user in a visual way. More...
 
void append_data (CommandLineParser &cmdParser)
 This function handles appending data sets to already existing data. More...
 
void clear_cache (MemoryManager &_data, Settings &_option, bool bIgnore=false)
 This function removes all allocated tables and frees the assigned memory. More...
 
bool deleteCacheEntry (CommandLineParser &cmdParser)
 This function removes one or multiple entries in the selected table or cluster. More...
 
bool CopyData (CommandLineParser &cmdParser)
 This function copies whole chunks of data between tables. More...
 
bool moveData (CommandLineParser &cmdParser)
 This function will move the selected part of a data table to a new location. More...
 
bool sortData (CommandLineParser &cmdParser)
 This function is a wrapper for the corresponding member function of the Datafile object. More...
 
bool writeToFile (CommandLineParser &cmdParser)
 This function writes the string contents in the command to a file. More...
 
bool readFromFile (CommandLineParser &cmdParser)
 This function reads the content of a file as strings and copies them to a temporary string vector variable. More...
 
bool readImage (CommandLineParser &cmdParser)
 This function reads image data from an image file and stores it as a cache table. More...
 

Function Documentation

◆ append_data()

◆ clear_cache()

void clear_cache ( MemoryManager _data,
Settings _option,
bool  bIgnore 
)

This function removes all allocated tables and frees the assigned memory.

Parameters
_dataDatafile&
_optionSettings&
bIgnorebool
Returns
void

Definition at line 428 of file dataops.cpp.

References _lang, Language::get(), Settings::getExePath(), NumeReKernel::getline(), Settings::getSavePath(), MemoryManager::getSaveStatus(), MemoryManager::isValid(), LineBreak(), NumeReKernel::print(), NumeReKernel::printPreFmt(), MemoryManager::removeTablesFromMemory(), Settings::systemPrints(), and Language::YES().

Referenced by cmd_clear().

Here is the call graph for this function:

◆ CopyData()

bool CopyData ( CommandLineParser cmdParser)

This function copies whole chunks of data between tables.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 620 of file dataops.cpp.

References DataAccessParser::evalIndices(), evaluateTransposeForDataOperation(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), and performDataOperation().

Referenced by cmd_copy().

Here is the call graph for this function:

◆ deleteCacheEntry()

bool deleteCacheEntry ( CommandLineParser cmdParser)

This function removes one or multiple entries in the selected table or cluster.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 579 of file dataops.cpp.

References CommandLineParser::getExpr(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), getNextArgument(), NumeReKernel::getParser(), NumeReKernel::getSettings(), NumeRe::ClusterManager::isCluster(), searchAndDeleteCluster(), searchAndDeleteTable(), and StripSpaces().

Referenced by cmd_delete().

Here is the call graph for this function:

◆ load_data()

void load_data ( MemoryManager _data,
Settings _option,
Parser _parser,
string  sFileName 
)

This function is a wrapper for the Datafile object. It will simply do the whole UI stuff and let the Datafile object do the hard work.

Parameters
_dataDatafile&
_optionSettings&
_parserParser&
sFileNamestring
Returns
void

Definition at line 53 of file dataops.cpp.

References _lang, append_data(), CommandLineParser::CMD_DAT_PAR, Language::get(), NumeRe::FileAdapter::getDataFileName(), NumeReKernel::getline(), FileSystem::getPath(), MemoryManager::isEmpty(), LineBreak(), NumeRe::FileAdapter::openFile(), NumeReKernel::print(), NumeReKernel::printPreFmt(), MemoryManager::removeData(), StripSpaces(), and Language::YES().

Referenced by cmd_load().

Here is the call graph for this function:

◆ moveData()

bool moveData ( CommandLineParser cmdParser)

This function will move the selected part of a data table to a new location.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 655 of file dataops.cpp.

References DataAccessParser::evalIndices(), evaluateTransposeForDataOperation(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), and performDataOperation().

Referenced by cmd_move().

Here is the call graph for this function:

◆ readFromFile()

bool readFromFile ( CommandLineParser cmdParser)

This function reads the content of a file as strings and copies them to a temporary string vector variable.

Parameters
cmdParserCommandLineParser&
Returns
bool

Definition at line 1145 of file dataops.cpp.

References SyntaxError::CANNOT_READ_FILE, getAllArguments(), CommandLineParser::getCommandLine(), CommandLineParser::getExprAsFileName(), StyledTextFile::getLine(), StyledTextFile::getLinesCount(), CommandLineParser::getParameterValueAsString(), StyledTextFile::getStrippedLine(), CommandLineParser::hasParam(), SyntaxError::invalid_position, SyntaxError::NO_FILENAME, removeQuotationMarks(), replaceAll(), StyledTextFile::reStyle(), CommandLineParser::setReturnValue(), and StripSpaces().

Referenced by cmd_read().

Here is the call graph for this function:

◆ readImage()

◆ show_data()

void show_data ( MemoryManager _data,
Output _out,
Settings _option,
const string &  _sCache,
size_t  nPrecision 
)

This function presents the passed data to the user in a visual way.

Parameters
_dataDatafile&
_outOutput&
_optionSettings&
_sCacheconst string&
nPrecisionsize_t
Returns
void

Definition at line 281 of file dataops.cpp.

References MemoryManager::extractTable(), Output::format(), NumeRe::FileAdapter::getDataFileName(), SyntaxError::invalid_position, MemoryManager::isValid(), make_hline(), make_stringmatrix(), SyntaxError::NO_CACHED_DATA, NumeReKernel::print(), Output::reset(), Output::setPluginName(), Output::setPrefix(), NumeReKernel::showTable(), NumeReKernel::toggleTableStatus(), toUpperCase(), and Settings::useExternalDocWindow().

Referenced by cmd_show().

Here is the call graph for this function:

◆ sortData()

◆ writeToFile()