BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
DatafieldIOHistory Class Reference

Description

Save history information for set of directories.

Definition at line 71 of file IOHistory.h.

Public Member Functions

bool hasHistory (const QString &dirname) const
 
QStringList savedFileNames (const QString &dirname) const
 
void setHistory (const QString &dirname, const DatafieldDirHistory &history)
 Sets history for given directory. Previous history will be rewritten. More...
 
bool wasModifiedSinceLastSave (const QString &dirname, const SaveLoadInterface *item)
 

Private Attributes

QMap< QString, DatafieldDirHistorym_dir_history
 < Correspondence of directory name to save history. More...
 

Member Function Documentation

◆ hasHistory()

bool DatafieldIOHistory::hasHistory ( const QString &  dirname) const

Definition at line 97 of file IOHistory.cpp.

98 {
99  return m_dir_history.find(dirname) != m_dir_history.end();
100 }
QMap< QString, DatafieldDirHistory > m_dir_history
< Correspondence of directory name to save history.
Definition: IOHistory.h:83

References m_dir_history.

Referenced by DatafieldIOService::save(), savedFileNames(), and wasModifiedSinceLastSave().

◆ savedFileNames()

QStringList DatafieldIOHistory::savedFileNames ( const QString &  dirname) const

Definition at line 121 of file IOHistory.cpp.

122 {
123  if (!hasHistory(dirname))
124  throw Error("DatafieldIOHistory::savedFileNames() -> Error. "
125  "No info for directory '"
126  + dirname + "'.");
127 
128  return m_dir_history[dirname].savedFileNames();
129 }
bool hasHistory(const QString &dirname) const
Definition: IOHistory.cpp:97

References Error, hasHistory(), and m_dir_history.

Referenced by DatafieldIOService::save().

Here is the call graph for this function:

◆ setHistory()

void DatafieldIOHistory::setHistory ( const QString &  dirname,
const DatafieldDirHistory history 
)

Sets history for given directory. Previous history will be rewritten.

Definition at line 114 of file IOHistory.cpp.

115 {
116  ASSERT(!dirname.isEmpty());
117 
118  m_dir_history[dirname] = history;
119 }

References m_dir_history.

Referenced by DatafieldIOService::loadDataFiles(), and DatafieldIOService::save().

◆ wasModifiedSinceLastSave()

bool DatafieldIOHistory::wasModifiedSinceLastSave ( const QString &  dirname,
const SaveLoadInterface item 
)

Definition at line 102 of file IOHistory.cpp.

104 {
105  if (!hasHistory(dirname))
106  throw Error("DatafieldIOHistory::wasModifiedSinceLastSave() -> Error. "
107  "No info for directory '"
108  + dirname + "'.");
109  return m_dir_history[dirname].wasModifiedSinceLastSave(item);
110 }

References Error, hasHistory(), and m_dir_history.

Referenced by DatafieldIOService::save().

Here is the call graph for this function:

Member Data Documentation

◆ m_dir_history

QMap<QString, DatafieldDirHistory> DatafieldIOHistory::m_dir_history
private

< Correspondence of directory name to save history.

Definition at line 83 of file IOHistory.h.

Referenced by hasHistory(), savedFileNames(), setHistory(), and wasModifiedSinceLastSave().


The documentation for this class was generated from the following files: