20#include "../utils/tools.hpp"
21#include "../io/logger.hpp"
84 if (!iter->get() || !iter->get()->size())
118 if (!
fileExists(sFile) && (_sFile.find(
'.') == string::npos || _sFile.find(
'.') < _sFile.rfind(
'/')))
192 if (sTargetTable.length())
194 melt(_mem, sTargetTable, overrideTarget);
240 if (!_sFileName.length())
244 string sTemp =
sPath;
266 if (sTable !=
"data")
375 while (sTime.find(
'\\') != string::npos)
376 sTime[sTime.find(
'\\')] =
'/';
void info(const std::string &sMessage)
Convenience member function.
void debug(const std::string &sMessage)
Convenience member function.
This class implements the basic input/ output file system and provides functionalities to work with f...
std::string sExecutablePath
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
int setPath(std::string _sPath, bool bMkDir, std::string _sExePath)
This member function may be used to set the preferred file path of the current FileSystem instance.
This class represents a single table in memory, or a - so to say - single memory page to be handled b...
TableColumnArray memArray
bool isValid() const
Returns true, if at least a single valid value is available in this table.
void setSaveStatus(bool _bIsSaved)
This member function changes the saved state to the passed value.
bool resizeMemory(size_t _nLines, size_t _nCols)
This member function will handle all memory grow operations by doubling the base size,...
bool shrink()
This member function shrinks the table memory to the smallest possible dimensions reachable in powers...
void setMetaData(const NumeRe::TableMetaData &meta)
Update the internal meta data with the passed one.
void createTableHeaders()
This member function creates the column headlines, if they are empty.
void convert()
This member function tries to convert all string columns to value columns, if it is possible.
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.
Template class representing a generic file. This class may be specified for the main data type contai...
void getData(TableColumnArray *data)
This method copies the internal data to the passed memory address. The target memory must already exi...
virtual bool read()=0
Pure virtual declaration of the read access method. Has to be implemented in all derived classes and ...
virtual FileHeaderInfo getFileHeaderInformation()
Returns the file header information structure.
std::string getExtension()
Returns the file extension.
This class resembles an Igor binary wave file format (*.ibw). The data is read by the WaveMetrics imp...
Common exception class for all exceptions thrown in NumeRe.
static size_t invalid_position
bool fileExists(const string &)
This function checks, whether the file with the passed file name exists.
GenericFile * getFileByType(const string &filename)
This function determines the correct class to be used for the filename passed to this function....
std::string toString(int)
Converts an integer to a string without the Settings bloat.