19#ifndef FILEADAPTER_HPP
20#define FILEADAPTER_HPP
22#include "../io/file.hpp"
23#include "../io/filesystem.hpp"
24#include "../settings.hpp"
50 virtual bool saveLayer(std::string _sFileName,
const std::string& _sCache,
unsigned short nPrecision) = 0;
56 FileHeaderInfo openFile(std::string _sFile,
bool loadToCache =
false,
bool overrideTarget =
false,
int _nHeadline = 0,
const std::string& sTargetTable =
"");
57 bool saveFile(
const std::string& sTable, std::string _sFileName,
unsigned short nPrecision = 7);
62 void setPrefix(
const std::string& _sPrefix);
66 virtual void melt(
Memory* _mem,
const std::string& sTable,
bool overrideTarget =
false) = 0;
This class implements the basic input/ output file system and provides functionalities to work with f...
This class represents a single table in memory, or a - so to say - single memory page to be handled b...
This class represents the file input and output adapter for the MemoryManager class,...
std::string getDataFileName(const std::string &sTable) const
This member function will return the file name of the selected table. Will default to the table name.
std::string getDate()
This private member function will return the current date as a timestamp for the file name.
std::string getOutputFileName() const
This member function will return the output file name, which was used for saving the last table.
FileAdapter()
FileAdapted default constructor.
bool bLoadEmptyColsInNextFile
void setbLoadEmptyColsInNextFile(bool _bLoadEmptyCols)
Set, whether empty columns shall be loaded in the next file.
FileHeaderInfo openFile(std::string _sFile, bool loadToCache=false, bool overrideTarget=false, int _nHeadline=0, const std::string &sTargetTable="")
This member function loads the contents of the selected file to a new Memory class instance....
virtual bool saveLayer(std::string _sFileName, const std::string &_sCache, unsigned short nPrecision)=0
bool saveFile(const std::string &sTable, std::string _sFileName, unsigned short nPrecision=7)
This member function wraps the saving functionality of the Memory class. The passed filename is evalu...
void setSavePath(const std::string &_sPath)
This function may be used to update the target saving path of this class.
virtual void melt(Memory *_mem, const std::string &sTable, bool overrideTarget=false)=0
std::string getDataFileNameShort() const
This member function will return a shortened version of the data file name, where each "/Path/" strin...
void setbLoadEmptyCols(bool _bLoadEmptyCols)
Set, whether empty columns shall be loaded.
void condenseDataSet(Memory *_mem)
This member function will condense the data set in the passed Memory instance, i.e....
void setPrefix(const std::string &_sPrefix)
This function is used to set a file prefix for the saving file name.
std::string generateFileName(const std::string &sExtension=".ndat")
This member function creates a file name from the file prefix and the time stamp.