16 #include "Base/Util/Assert.h"
51 throw Error(
"DatafieldDirHistory::markAsSaved() -> Error. "
52 "Already existing item.");
67 if (info.item() == item)
80 result.append(info.fileName());
88 if (info.item() == item)
92 throw Error(
"DatafieldDirHistory::itemInfo() -> Error. No info exists.");
106 throw Error(
"DatafieldIOHistory::wasModifiedSinceLastSave() -> Error. "
107 "No info for directory '"
109 return m_dir_history[dirname].wasModifiedSinceLastSave(item);
116 ASSERT(!dirname.isEmpty());
124 throw Error(
"DatafieldIOHistory::savedFileNames() -> Error. "
125 "No info for directory '"
Defines DatafieldIOHistory classes.
Defines save/load interface.
Save history information for collection of items with non-XML data.
QStringList savedFileNames() const
Returns list of file names used to save all items in a history.
DatafieldSaveInfo itemInfo(const SaveLoadInterface *item) const
bool wasModifiedSinceLastSave(const SaveLoadInterface *item)
bool contains(const SaveLoadInterface *item)
QVector< DatafieldSaveInfo > m_history
void markAsSaved(const SaveLoadInterface *item)
void setHistory(const QString &dirname, const DatafieldDirHistory &history)
Sets history for given directory. Previous history will be rewritten.
bool wasModifiedSinceLastSave(const QString &dirname, const SaveLoadInterface *item)
QStringList savedFileNames(const QString &dirname) const
QMap< QString, DatafieldDirHistory > m_dir_history
< Correspondence of directory name to save history.
bool hasHistory(const QString &dirname) const
Holds information about last save for items with non-XML data.
static DatafieldSaveInfo createSaved(const SaveLoadInterface *item)
Static method to create info for just saved item.
const SaveLoadInterface * m_data
const SaveLoadInterface * item() const
bool wasSavedBefore(const QDateTime &dtime) const
Returns true if IntensityDataItem was saved before given time.
bool wasModifiedSinceLastSave() const
Abstract base class to handle non-XML data save and load.
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
virtual bool containsNonXMLData() const =0
Checks if object owns non-XML data.
virtual QDateTime lastModified() const =0
Indicates last modification timepoint.