NorMIT-nav  22.09
An IGT application
cxDataLocations.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXDATALOCATIONS_H_
12 #define CXDATALOCATIONS_H_
13 
14 #include "cxResourceExport.h"
15 
16 #include <QString>
17 #include <QObject>
18 #include "boost/shared_ptr.hpp"
19 
20 class QSettings;
21 
22 namespace cx
23 {
24 
31 class cxResource_EXPORT DataLocations
32 {
33 public:
34  static QString getBundlePath();
35  static QString getRootConfigPath();
36  static QStringList getRootConfigPaths();
37 
38  static QString getTestDataPath();
39  static QString getLargeTestDataPath();
40  static QString getExistingTestData(QString pathRelativeToTestDataRoot, QString filename="");
41 
42  static QString getDocPath();
43  static QString getPersistentWritablePath();
44  static void deletePersistentWritablePath();
45  static QString getCachePath();
46  static QStringList getDefaultPluginsPath();
47 
48  static void setTestMode();
49  static QString findExecutableInStandardLocations(QString filename);
50 
51  static QStringList appendStringToAllElements(QStringList root, QString suffix);
52 
53  static QString findConfigFolder(QString pathRelativeToConfigRoot, QString alternativeAbsolutePath = "");
54  static QString findConfigFilePath(QString fileName, QString pathRelativeToConfigRoot, QString alternativeAbsolutePath = "");
55  static QString findConfigPath(QString fileName, QString pathRelativeToConfigRoot, QString alternativeAbsolutePath = "");
56 
57  static void setWebsiteURL(QString websiteUrl);
58  static QString getWebsiteURL();
59  static QString getUploadsUrl();
60  static QString getWebsiteUserDocumentationURL();
61 
62  static bool isRunFromBuildFolder();
63  static bool isTestMode();
64 
65 private:
66  static bool mTestMode;
67  static bool mRunFromBuildFolder;
68  static bool mBuildFolderChecked;
69  static QString mWebsiteUrl;
70  static QString readTestDataPathFromFile(QString filename);
71  static QString checkExecutableExist(QString path, QString filename);
72 
73 };
74 
75 } // namespace cx
76 
77 #endif /* CXDATALOCATIONS_H_ */
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::DataLocations
Definition: cxDataLocations.h:31