DtkCore
DTK Core module
载入中...
搜索中...
未找到
dutil.h 文件参考
#include <QTimer>
#include <QThread>
#include <QMetaObject>
#include <QCoreApplication>
#include <QRegularExpression>
#include <QStandardPaths>
#include <QDir>
#include <type_traits>
#include <cstring>

浏览源代码.

函数

template<typename Func1 >
void DUtil::TimerSingleShot (int msec, Func1 slot)
 
template<class T >
void DUtil::SecureErase (T *p, size_t size)
 
template<class T >
void DUtil::SecureErase (T &obj)
 
QString DUtil::escapeToObjectPath (const QString &str)
 将字符串转义成符合DBus ObjectPath规则字符串
 
QString DUtil::unescapeFromObjectPath (const QString &str)
 将DBus ObjectPath的部分路径转义成原来的字符串
 
QString DUtil::getAppIdFromAbsolutePath (const QString &path)
 从desktop文件的绝对路径中提取出AppId
 
QStringList DUtil::getAbsolutePathFromAppId (const QString &appId)
 从appId中获取符合条件的Desktop文件路径
 

详细描述

@chinese

该文件定义和实现了一些小的工具函数.

函数说明

◆ escapeToObjectPath()

QString DUtil::escapeToObjectPath ( const QString &  str)
inline

将字符串转义成符合DBus ObjectPath规则字符串

参数
[in]str需要转义的字符串
返回
转义后字符串
注意
不要传入完整的dbus路径, 否则'/'也会被转义

◆ getAbsolutePathFromAppId()

QStringList DUtil::getAbsolutePathFromAppId ( const QString &  appId)
inline

从appId中获取符合条件的Desktop文件路径

参数
[in]appIdapp的Id
返回
desktop文件的路径
注意
可能有多个desktop文件的appId相同, 所以返回所有符合条件的列表

◆ getAppIdFromAbsolutePath()

QString DUtil::getAppIdFromAbsolutePath ( const QString &  path)
inline

从desktop文件的绝对路径中提取出AppId

参数
[in]path文件路径
返回
代表AppId的字符串
注意
AppId可能为空, 代表无法获取AppId

◆ unescapeFromObjectPath()

QString DUtil::unescapeFromObjectPath ( const QString &  str)
inline

将DBus ObjectPath的部分路径转义成原来的字符串

参数
[in]str需要转义的字符串
返回
转义后字符串