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

Purely virtual interface to handle non-XML data save and load. More...

Inheritance diagram for SaveLoadInterface:
[legend]

Public Member Functions

virtual ~SaveLoadInterface ()
 
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 load (const QString &projectDir)=0
 Loads non-XML data from projectDir and returns success flag. More...
 
virtual bool save (const QString &projectDir)=0
 Saves non-XML data in projectDir and returns success flag. More...
 

Detailed Description

Purely virtual interface to handle non-XML data save and load.

Definition at line 24 of file SaveLoadInterface.h.

Constructor & Destructor Documentation

◆ ~SaveLoadInterface()

SaveLoadInterface::~SaveLoadInterface ( )
virtualdefault

Member Function Documentation

◆ containsNonXMLData()

virtual bool SaveLoadInterface::containsNonXMLData ( ) const
pure virtual

Checks if object owns non-XML data.

Implemented in PointwiseAxisItem, and DataItem.

Referenced by OutputDataDirHistory::markAsSaved().

◆ fileName() [1/2]

virtual QString SaveLoadInterface::fileName ( ) const
pure virtual

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

Implemented in PointwiseAxisItem, and DataItem.

Referenced by OutputDataSaveInfo::createSaved(), fileName(), PointwiseAxisItem::load(), and PointwiseAxisItem::save().

◆ 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 19 of file SaveLoadInterface.cpp.

20 {
21  const auto filename = fileName();
22  return projectDir.isEmpty() ? filename : projectDir + "/" + filename;
23 }
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
std::string filename(const std::string &path)
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.

References fileName(), FileSystemUtils::filename(), and ProjectUtils::projectDir().

Here is the call graph for this function:

◆ lastModified()

virtual QDateTime SaveLoadInterface::lastModified ( ) const
pure virtual

Indicates last modification timepoint.

Implemented in PointwiseAxisItem, and DataItem.

Referenced by OutputDataSaveInfo::wasModifiedSinceLastSave().

◆ load()

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

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

Implemented in PointwiseAxisItem, and DataItem.

◆ save()

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

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

Implemented in PointwiseAxisItem, and DataItem.


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