NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <string>
#include "memorymanager.hpp"
#include "../settings.hpp"
#include "../commandlineparser.hpp"
#include "../ParserLib/muParser.h"
#include "../io/output.hpp"
#include "../maths/define.hpp"
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... | |
void append_data | ( | CommandLineParser & | cmdParser | ) |
This function handles appending data sets to already existing data.
cmdParser | CommandLineParser& |
Definition at line 346 of file dataops.cpp.
References _lang, SyntaxError::FILE_NOT_EXIST, Language::get(), MemoryManager::getCols(), CommandLineParser::getCommandLine(), getFileList(), NumeReKernel::getInstance(), MemoryManager::getLines(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsNumericalValue(), NumeReKernel::getSettings(), CommandLineParser::hasParam(), intCast(), SyntaxError::invalid_position, MemoryManager::isEmpty(), LineBreak(), NumeRe::FileHeaderInfo::nCols, NumeRe::FileHeaderInfo::nRows, NumeRe::FileAdapter::openFile(), CommandLineParser::parseExprAsString(), NumeReKernel::print(), NumeRe::FileAdapter::setbLoadEmptyColsInNextFile(), NumeRe::FileHeaderInfo::sFileName, Settings::systemPrints(), and toString().
Referenced by cmd_append(), cmd_load(), and load_data().
void clear_cache | ( | MemoryManager & | _data, |
Settings & | _option, | ||
bool | bIgnore | ||
) |
This function removes all allocated tables and frees the assigned memory.
_data | Datafile& |
_option | Settings& |
bIgnore | bool |
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().
bool CopyData | ( | CommandLineParser & | cmdParser | ) |
This function copies whole chunks of data between tables.
cmdParser | CommandLineParser& |
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().
bool deleteCacheEntry | ( | CommandLineParser & | cmdParser | ) |
This function removes one or multiple entries in the selected table or cluster.
cmdParser | CommandLineParser& |
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().
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.
_data | Datafile& |
_option | Settings& |
_parser | Parser& |
sFileName | string |
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().
bool moveData | ( | CommandLineParser & | cmdParser | ) |
This function will move the selected part of a data table to a new location.
cmdParser | CommandLineParser& |
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().
bool readFromFile | ( | CommandLineParser & | cmdParser | ) |
This function reads the content of a file as strings and copies them to a temporary string vector variable.
cmdParser | CommandLineParser& |
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().
bool readImage | ( | CommandLineParser & | cmdParser | ) |
This function reads image data from an image file and stores it as a cache table.
CommandLineParser& | cmdParser |
Definition at line 1234 of file dataops.cpp.
References SyntaxError::CANNOT_READ_FILE, Indices::col, DetachedLogger::debug(), VectorIndex::front(), g_logger, CommandLineParser::getCommandLine(), CommandLineParser::getExprAsFileName(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterValueAsString(), MemoryManager::getTable(), CommandLineParser::getTargetTable(), CommandLineParser::hasParam(), DetachedLogger::info(), VectorIndex::INVALID, SyntaxError::invalid_position, VectorIndex::isOpenEnd(), Memory::markModified(), VectorIndex::max(), max, VectorIndex::min(), SyntaxError::NO_FILENAME, Indices::row, MemoryManager::setHeadLineElement(), Memory::setHeadLineElement(), VectorIndex::setRange(), CommandLineParser::setReturnValue(), VectorIndex::subidx(), toString(), Memory::writeData(), and Memory::writeDataDirectUnsafe().
Referenced by cmd_imread().
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.
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().
bool sortData | ( | CommandLineParser & | cmdParser | ) |
This function is a wrapper for the corresponding member function of the Datafile object.
cmdParser | CommandLineParser& |
Definition at line 933 of file dataops.cpp.
References CommandLineParser::clearReturnValue(), Indices::col, DataAccessParser::evalIndices(), VectorIndex::front(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), CommandLineParser::getExprAsDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, DataAccessParser::isCluster(), isValidIndexSet(), VectorIndex::last(), Indices::row, CommandLineParser::setReturnValue(), sortClusters(), MemoryManager::sortElements(), sortStrings(), SyntaxError::TABLE_DOESNT_EXIST, and VectorIndex::to_string().
Referenced by cmd_sort().
bool writeToFile | ( | CommandLineParser & | cmdParser | ) |
This function writes the string contents in the command to a file.
cmdParser | CommandLineParser& |
Definition at line 998 of file dataops.cpp.
References SyntaxError::CANNOT_READ_FILE, NumeRe::StringParser::evalAndFormat(), fileExists(), SyntaxError::FILETYPE_MAY_NOT_BE_WRITTEN, CommandLineParser::getCommandLine(), CommandLineParser::getExpr(), CommandLineParser::getFileParameterValueForSaving(), NumeReKernel::getInstance(), getNextArgument(), CommandLineParser::getParameterList(), CommandLineParser::getParameterValue(), NumeReKernel::getStringParser(), CommandLineParser::hasParam(), FileSystem::initializeFromKernel(), SyntaxError::invalid_position, SyntaxError::NO_FILENAME, SyntaxError::NO_STRING_FOR_WRITING, sErrorToken, StripSpaces(), and date::detail::trunc().
Referenced by cmd_write().