BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SaveLoadInterface.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/mainwindow/SaveLoadInterface.h
6 //! @brief Defines save/load interface.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_MAINWINDOW_SAVELOADINTERFACE_H
16 #define BORNAGAIN_GUI_COREGUI_MAINWINDOW_SAVELOADINTERFACE_H
17 
18 #include <QDateTime>
19 #include <QString>
20 
21 //! Purely virtual interface to handle non-XML
22 //! data save and load.
23 
25 public:
26  virtual ~SaveLoadInterface();
27 
28  //! Loads non-XML data from _projectDir_ and returns
29  //! success flag.
30  virtual bool load(const QString& projectDir) = 0;
31 
32  //! Saves non-XML data in _projectDir_ and returns
33  //! success flag.
34  virtual bool save(const QString& projectDir) = 0;
35 
36  //! Checks if object owns non-XML data
37  virtual bool containsNonXMLData() const = 0;
38 
39  //! Indicates last modification timepoint.
40  virtual QDateTime lastModified() const = 0;
41 
42  //! Reports file name to save/load non-XML data.
43  virtual QString fileName() const = 0;
44 
45  //! Reports file name to save/load non-XML data with directory
46  //! name attached.
47  QString fileName(const QString& projectDir) const;
48 };
49 
50 #endif // BORNAGAIN_GUI_COREGUI_MAINWINDOW_SAVELOADINTERFACE_H
Purely virtual interface to handle non-XML data save and load.
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
virtual bool load(const QString &projectDir)=0
Loads non-XML data from projectDir and returns success flag.
virtual bool containsNonXMLData() const =0
Checks if object owns non-XML data.
virtual QDateTime lastModified() const =0
Indicates last modification timepoint.
virtual bool save(const QString &projectDir)=0
Saves non-XML data in projectDir and returns success flag.
virtual ~SaveLoadInterface()
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.