Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerUtils.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerUtils_h
22 #define __qSlicerUtils_h
23 
24 #include <QFile>
25 #include <QString>
26 
27 #include "qSlicerBaseQTCoreExport.h"
28 
30 
31 class Q_SLICER_BASE_QTCORE_EXPORT qSlicerUtils
32 {
33 
34 public:
35  typedef qSlicerUtils Self;
36 
40  static bool isExecutableName(const QString& name);
41 
43  static bool isCLIExecutable(const QString& filePath);
44 
46  static bool isCLIScriptedExecutable(const QString& filePath);
47 
51  static bool isCLILoadableModule(const QString& filePath);
52 
56  static bool isLoadableModule(const QString& filePath);
57 
61  static bool isTestingModule(qSlicerAbstractCoreModule* module);
62 
67  static QString searchTargetInIntDir(const QString& directory, const QString& target);
68 
71  static QString executableExtension();
72 
74  //static QString libraryExtension();
75 
81  static QString extractModuleNameFromLibraryName(const QString& libraryName);
82 
86  static QString extractModuleNameFromClassName(const QString& className);
87 
92  static bool isPluginInstalled(const QString& filePath, const QString& applicationHomeDir);
93 
95  static bool isPluginBuiltIn(const QString& filePath, const QString& applicationHomeDir, const QString& applicationRevision);
96 
170  static QString pathWithoutIntDir(const QString& path, const QString& subDirWithoutIntDir);
171  static QString pathWithoutIntDir(const QString& path, const QString& subDirWithoutIntDir, QString& intDir);
172 
174  static bool pathEndsWith(const QString& inputPath, const QString& path);
175 
176 
184  static bool setPermissionsRecursively(const QString &path,
185  QFile::Permissions directoryPermissions,
186  QFile::Permissions filePermissions);
187 
212  static QString replaceWikiUrlVersion(const QString& text, const QString& version);
213 
232  static QString replaceDocumentationUrlVersion(const QString& text, const QString& hostname, const QString& version);
233 
234 private:
236  qSlicerUtils() = default;
237  virtual ~qSlicerUtils() = default;
238 
239 };
240 
241 #endif
string version
Definition: conf.py:73
qSlicerUtils Self
Definition: qSlicerUtils.h:35
qSlicerAbstractCoreModule is the base class of any module in Slicer.