BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ProjectUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Support/IO/ProjectUtils.h
6 //! @brief Defines namespace GUI::Project::Utils
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_SUPPORT_IO_PROJECTUTILS_H
16 #define BORNAGAIN_GUI_SUPPORT_IO_PROJECTUTILS_H
17 
18 #include <QString>
19 
20 //! Defines convenience function for project manager and document.
21 
23 
24 inline constexpr const char* projectFileExtension{".pro"};
25 
26 //! Returns project name deduced from project file name.
27 QString projectName(const QString& projectFileName);
28 
29 //! Returns project directory deduced from project file name.
30 QString projectDir(const QString& projectFileName);
31 
32 //! Returns fixed name for autosave sub-directory.
33 QString autosaveSubdir();
34 
35 //! Returns name of autosave directory for project with given project file name.
36 //! E.g. from '/projects/Untitled2/Untitled2.pro' returns '/projects/Untitled2/autosave'
37 QString autosaveDir(const QString& projectFileName);
38 
39 //! Returns name of project for autoSave from given project file name.
40 //! E.g. from '/projects/Untitled2/Untitled2.pro' returns
41 //! '/projects/Untitled2/autosave/Untitled2.pro'
42 QString autosaveName(const QString& projectFileName);
43 
44 //! Returns true if project with given projectFileName contains autosaved data.
45 bool hasAutosavedData(const QString& projectFileName);
46 
47 } // namespace GUI::Project::Utils
48 
49 #endif // BORNAGAIN_GUI_SUPPORT_IO_PROJECTUTILS_H
Defines convenience function for project manager and document.
Definition: ProjectUtils.h:22
constexpr const char * projectFileExtension
Definition: ProjectUtils.h:24
QString autosaveSubdir()
Returns fixed name for autosave sub-directory.
QString autosaveDir(const QString &projectFileName)
Returns name of autosave directory for project with given project file name. E.g. from '/projects/Unt...
bool hasAutosavedData(const QString &projectFileName)
Returns true if project with given projectFileName contains autosaved data.
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.
QString projectName(const QString &projectFileName)
Returns project name deduced from project file name.
QString autosaveName(const QString &projectFileName)
Returns name of project for autoSave from given project file name. E.g. from '/projects/Untitled2/Unt...