BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SaveLoadInterface Class Referenceabstract

Description

Abstract base class to handle non-XML data save and load.

Inherited (mix-in) by DataItem

Definition at line 25 of file SaveLoadInterface.h.

Inheritance diagram for SaveLoadInterface:
[legend]

Public Member Functions

virtual ~SaveLoadInterface ()=default
 
virtual bool containsNonXMLData () const =0
 Checks if object owns non-XML data. More...
 
virtual QString fileName () const =0
 Reports file name to save/load non-XML data. More...
 
QString fileName (const QString &projectDir) const
 Reports file name to save/load non-XML data with directory name attached. More...
 
virtual QDateTime lastModified () const =0
 Indicates last modification timepoint. More...
 
virtual bool loadData (const QString &projectDir)=0
 Loads non-XML data from projectDir and returns success flag. More...
 
virtual bool saveData (const QString &projectDir)=0
 Saves non-XML data in projectDir and returns success flag. More...
 

Constructor & Destructor Documentation

◆ ~SaveLoadInterface()

virtual SaveLoadInterface::~SaveLoadInterface ( )
virtualdefault

Member Function Documentation

◆ containsNonXMLData()

virtual bool SaveLoadInterface::containsNonXMLData ( ) const
pure virtual

Checks if object owns non-XML data.

Implemented in DataItem.

Referenced by DatafieldDirHistory::markAsSaved().

◆ fileName() [1/2]

virtual QString SaveLoadInterface::fileName ( ) const
pure virtual

Reports file name to save/load non-XML data.

Implemented in DataItem.

Referenced by DatafieldSaveInfo::createSaved(), and fileName().

◆ fileName() [2/2]

QString SaveLoadInterface::fileName ( const QString &  projectDir) const

Reports file name to save/load non-XML data with directory name attached.

Definition at line 18 of file SaveLoadInterface.cpp.

19 {
20  return QString::fromStdString(
21  BaseUtils::Filesystem::jointPath(projectDir.toStdString(), fileName().toStdString()));
22 }
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.

References fileName(), and GUI::Project::Utils::projectDir().

Here is the call graph for this function:

◆ lastModified()

virtual QDateTime SaveLoadInterface::lastModified ( ) const
pure virtual

Indicates last modification timepoint.

Implemented in DataItem.

Referenced by DatafieldSaveInfo::wasModifiedSinceLastSave().

◆ loadData()

virtual bool SaveLoadInterface::loadData ( const QString &  projectDir)
pure virtual

Loads non-XML data from projectDir and returns success flag.

Implemented in DataItem.

◆ saveData()

virtual bool SaveLoadInterface::saveData ( const QString &  projectDir)
pure virtual

Saves non-XML data in projectDir and returns success flag.

Implemented in DataItem.


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