5#ifndef DTK_CORE_FILESYSTEM_DSTANDARDPATHS_H
6#define DTK_CORE_FILESYSTEM_DSTANDARDPATHS_H
8#include <QStandardPaths>
10#include "dtkcore_global.h"
14class DStandardPathsPrivate;
27 static QString
locate(QStandardPaths::StandardLocation type,
const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
28 static QStringList
locateAll(QStandardPaths::StandardLocation type,
const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
29 static QString
findExecutable(
const QString &executableName,
const QStringList &paths = QStringList());
52#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
53 RuntimeTime [[deprecated(
"Use RuntimeDir Instead")]] = RuntimeDir,
71 static QString path(
XDG type);
72 static QString path(DSG type);
73 static QStringList
paths(DSG type);
74 static QString filePath(
XDG type, QString fileName);
75 static QString filePath(DSG type, QString fileName);
Definition dstandardpaths.h:16
static QString findExecutable(const QString &executableName, const QStringList &paths=QStringList())
同QStandardPaths::findExecutable, 查找可执行文件
static QString homePath(const uint uid)
用uid返回家目录
static QString homePath()
返回家目录
static QString writableLocation(QStandardPaths::StandardLocation type)
DStandardPaths提供兼容Snap/Dtk标准的路径模式。DStandardPaths实现了Qt的QStandardPaths主要接口。此处返回可写路径
static void setMode(Mode mode)
同QStandardPaths::setTestModeEnabled, 设置是否是测试模式
static QStringList standardLocations(QStandardPaths::StandardLocation type)
DStandardPaths提供兼容Snap/Dtk标准的路径模式。DStandardPaths实现了Qt的QStandardPaths主要接口。此处返回所有Standardpath
static QString locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options=QStandardPaths::LocateFile)
在 type 的标准位置查找名为 fileName 的文件或目录。选项标志允许您指定是否查找文件或目录。默认情况下,此标志设置为 LocateFile。返回找到的第一个文件或目录的绝对路径,否则返回空字...
static QStringList paths(DSG type)
返回所有DSG下所有目录
static QStringList locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options=QStandardPaths::LocateFile)
在类型的标准位置中按名称 fileName 查找所有文件或目录。选项标志允许您指定是否查找文件或目录。默认情况下,此标志设置为 LocateFile。返回找到的所有文件的列表。
XDG
About XDG dir, view it in https://gitlab.freedesktop.org/xdg/xdg-specs/
Definition dstandardpaths.h:35