Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
31class Q_SLICER_BASE_QTCORE_EXPORT qSlicerUtils
32{
33
34public:
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
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
183 static bool setPermissionsRecursively(const QString& path, QFile::Permissions directoryPermissions, QFile::Permissions filePermissions);
184
209 static QString replaceWikiUrlVersion(const QString& text, const QString& version);
210
229 static QString replaceDocumentationUrlVersion(const QString& text, const QString& hostname, const QString& version);
230
231private:
233 qSlicerUtils() = default;
234 virtual ~qSlicerUtils() = default;
235};
236
237#endif
qSlicerAbstractCoreModule is the base class of any module in Slicer.
static QString searchTargetInIntDir(const QString &directory, const QString &target)
static bool isPluginBuiltIn(const QString &filePath, const QString &applicationHomeDir, const QString &applicationRevision)
Return true if the plugin identified with its filePath is a built-in Slicer module.
static QString pathWithoutIntDir(const QString &path, const QString &subDirWithoutIntDir, QString &intDir)
static bool isLoadableModule(const QString &filePath)
static bool isExecutableName(const QString &name)
static QString extractModuleNameFromClassName(const QString &className)
static QString replaceDocumentationUrlVersion(const QString &text, const QString &hostname, const QString &version)
Return an updated text where Slicer documentation URL version is replaced with the provided one.
static QString extractModuleNameFromLibraryName(const QString &libraryName)
This function returns ".dll. on windows, ".so" on linux and ".dylib" on Mac.
qSlicerUtils Self
static bool isPluginInstalled(const QString &filePath, const QString &applicationHomeDir)
static bool setPermissionsRecursively(const QString &path, QFile::Permissions directoryPermissions, QFile::Permissions filePermissions)
static QString executableExtension()
static bool pathEndsWith(const QString &inputPath, const QString &path)
Return true if the inputPath ends with path.
static QString replaceWikiUrlVersion(const QString &text, const QString &version)
Return an updated text where Slicer wiki URL version is replaced with the provided one....
static bool isTestingModule(qSlicerAbstractCoreModule *module)
static bool isCLIExecutable(const QString &filePath)
Returns true if the filePath matches the CLI executable file name requirements.
static bool isCLIScriptedExecutable(const QString &filePath)
Returns true if the filePath matches scripted CLI requirements.
static QString pathWithoutIntDir(const QString &path, const QString &subDirWithoutIntDir)
static bool isCLILoadableModule(const QString &filePath)