BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SaveLoadInterface.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/mainwindow/SaveLoadInterface.cpp
6 //! @brief Impelments 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 
16 
18 
19 QString SaveLoadInterface::fileName(const QString& projectDir) const
20 {
21  const auto filename = fileName();
22  return projectDir.isEmpty() ? filename : projectDir + "/" + filename;
23 }
Defines save/load interface.
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
virtual ~SaveLoadInterface()
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.