BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
Path.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Util/Path.h
6 //! @brief Defines class Helpers functions
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_UTIL_PATH_H
16 #define BORNAGAIN_GUI_UTIL_PATH_H
17 
18 #include <QString>
19 
20 class QModelIndex;
21 
22 namespace GUI::Util::Path {
23 
24 QString withTildeHomePath(const QString& path);
25 
27 
28 QString getValidFileName(const QString& proposed_name);
29 
30 QString fileDir(const QString& fileName);
31 QString baseName(const QString& fileName);
32 
33 bool parseVersion(const QString& version, int& major_num, int& minor_num, int& patch_num);
34 
35 int versionCode(const QString& version);
36 
37 bool isVersionMatchMinimal(const QString& version, const QString& minimal_version);
38 
39 //! The folder where persistent application data shall be stored.
40 //! Under Windows this is the AppData/Roaming location.
41 //! Used e.g. for storing the instrument library.
42 QString appDataFolder();
43 
44 QString getPathFromIndex(const QModelIndex& index);
45 
46 } // namespace GUI::Util::Path
47 
48 #endif // BORNAGAIN_GUI_UTIL_PATH_H
QString appDataFolder()
The folder where persistent application data shall be stored. Under Windows this is the AppData/Roami...
Definition: Path.cpp:139
int versionCode(const QString &version)
Definition: Path.cpp:103
QString baseName(const QString &fileName)
Returns base name of file.
Definition: Path.cpp:133
QString fileDir(const QString &fileName)
Returns file directory from the full file path.
Definition: Path.cpp:123
QString getValidFileName(const QString &proposed_name)
Returns valid file name to be saved on disk. This name is constructed from proposed_name by replacing...
Definition: Path.cpp:74
bool parseVersion(const QString &version, int &major_num, int &minor_num, int &patch_num)
parses version string into 3 numbers, returns true in the case of success
Definition: Path.cpp:83
bool isVersionMatchMinimal(const QString &version, const QString &minimal_version)
Returns true if current BornAgain version match minimal required version.
Definition: Path.cpp:117
QString withTildeHomePath(const QString &path)
Definition: Path.cpp:45
QString getBornAgainVersionString()
Definition: Path.cpp:60
QString getPathFromIndex(const QModelIndex &index)
Definition: Path.cpp:144