|
dtkio
dtk library for dtkio.
|
用以获取文件的信息 更多...
#include <dfileinfo.h>


Public 成员函数 | |
| DFileInfo (const QUrl &url, QObject *parent=nullptr) | |
| 构造函数,通过文件的 url 构造一个新的 DFileInfo 对象 | |
| DFileInfo (const DFileInfo &other) | |
| 复制构造函数, 通过 other 构造一个新的 DFileInfo 对象 | |
| DFileInfo (DFileInfo &&other) noexcept | |
| 移动构造函数, 通过 other 构造一个新的 DFileInfo 对象 | |
| DFileInfo & | operator= (DFileInfo &&other) noexcept |
| 以右值引用的方式进行赋值操作 | |
| DFileInfo & | operator= (const DFileInfo &other) |
| 重载赋值操作,创建一个相同的对象 | |
| DTK_CORE_NAMESPACE::DExpected< QUrl > | url () const |
| 获取当前对象管理的文件的url字符串 | |
| void | setQueryAttributes (const QByteArray &attributes) |
| 设置查询属性 | |
| void | setQueryInfoFlags (const FileQueryInfoFlags flags) |
| 设置查询文件信息时的标志 | |
| DTK_CORE_NAMESPACE::DExpected< QByteArray > | queryAttributes () const |
| 获取已定义的查询属性 | |
| DTK_CORE_NAMESPACE::DExpected< FileQueryInfoFlags > | queryInfoFlag () const |
| 获取已定义的查询信息的标志 | |
| DTK_CORE_NAMESPACE::DExpected< bool > | initQuerier () |
| 根据查询属性和标志对文件信息进行初始化 | |
| DTK_CORE_NAMESPACE::DExpected< QVariant > | attribute (AttributeID id, bool *success=nullptr) const |
| 根据输入的id获取文件对应的属性 | |
| DTK_CORE_NAMESPACE::DExpected< QVariant > | attribute (const QByteArray &key, const AttributeType type) const |
| 根据输入的键值获取对应的文件属性 | |
| DTK_CORE_NAMESPACE::DExpected< bool > | hasAttribute (AttributeID id) const |
| 查询是否含有某个id的属性 | |
| DTK_CORE_NAMESPACE::DExpected< bool > | hasAttribute (const QByteArray &key) const |
| 查询是否含有key对应的属性 | |
| DTK_CORE_NAMESPACE::DExpected< bool > | exists () const |
| 文件信息是否存在 | |
| DTK_CORE_NAMESPACE::DExpected< bool > | refresh () |
| 重新根据查询属性来获取文件信息,应在queryAttributes发生变动后调用 | |
| DTK_CORE_NAMESPACE::DExpected< Permissions > | permissions () const |
| 获取当前文件的权限属性 | |
| DFileFuture * | initQuerierAsync (int ioPriority, QObject *parent=nullptr) |
| 异步的方式初始化查询 | |
| DFileFuture * | attributeAsync (AttributeID id, int ioPriority, QObject *parent=nullptr) const |
| 异步的方式获取文件属性 | |
| DFileFuture * | attributeAsync (const QByteArray &key, const AttributeType type, int ioPriority, QObject *parent=nullptr) const |
| 异步的方式获取文件属性 | |
| DFileFuture * | existsAsync (int ioPriority, QObject *parent=nullptr) const |
| 异步的方式查询文件是否存在 | |
| DFileFuture * | refreshAsync (int ioPriority, QObject *parent=nullptr) |
| 异步的方式刷新文件信息 | |
| DFileFuture * | permissionsAsync (int ioPriority, QObject *parent=nullptr) |
| 异步的方式获取文件权限属性 | |
| DTK_CORE_NAMESPACE::DError | lastError () const |
| 获取当前文件操作的错误码 | |
用以获取文件的信息
|
explicit |
构造函数,通过文件的 url 构造一个新的 DFileInfo 对象
| [in] | url | 文件的url |
| [in] | parent | 父类对象,用于内存管理 |
| DFileInfo::DFileInfo | ( | const DFileInfo & | other | ) |
复制构造函数, 通过 other 构造一个新的 DFileInfo 对象
| [in] | other | 原始对象 |
|
noexcept |
移动构造函数, 通过 other 构造一个新的 DFileInfo 对象
| [in] | other | 原始对象 |
| DExpected< QVariant > Dtk::IO::DFileInfo::attribute | ( | AttributeID | id, |
| bool * | success = nullptr |
||
| ) | const |
根据输入的id获取文件对应的属性
| [in] | id | 要查询的属性的id |
| [out] | success | 查询操作是否成功 |
| DExpected< QVariant > DFileInfo::attribute | ( | const QByteArray & | key, |
| const AttributeType | type | ||
| ) | const |
根据输入的键值获取对应的文件属性
| [in] | key | 文件属性对应的键值 |
| [out] | type | 文件属性的类型(字符、字节、布尔值等) |
| DFileFuture * Dtk::IO::DFileInfo::attributeAsync | ( | AttributeID | id, |
| int | ioPriority, | ||
| QObject * | parent = nullptr |
||
| ) | const |
异步的方式获取文件属性
| [in] | id | 要查询的属性id |
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| DFileFuture * Dtk::IO::DFileInfo::attributeAsync | ( | const QByteArray & | key, |
| const AttributeType | type, | ||
| int | ioPriority, | ||
| QObject * | parent = nullptr |
||
| ) | const |
异步的方式获取文件属性
| [in] | key | 要查询的属性键值 |
| [in] | type | 查询的属性的类型(字符、字节、布尔值等) |
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| DExpected< bool > DFileInfo::exists | ( | ) | const |
文件信息是否存在
| DFileFuture * DFileInfo::existsAsync | ( | int | ioPriority, |
| QObject * | parent = nullptr |
||
| ) | const |
异步的方式查询文件是否存在
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| DExpected< bool > DFileInfo::hasAttribute | ( | AttributeID | id | ) | const |
查询是否含有某个id的属性
| [in] | id | 要查询的id |
| DExpected< bool > DFileInfo::hasAttribute | ( | const QByteArray & | key | ) | const |
查询是否含有key对应的属性
| [in] | key | 要查询的key |
| DExpected< bool > DFileInfo::initQuerier | ( | ) |
根据查询属性和标志对文件信息进行初始化
| DFileFuture * DFileInfo::initQuerierAsync | ( | int | ioPriority, |
| QObject * | parent = nullptr |
||
| ) |
异步的方式初始化查询
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| DError DFileInfo::lastError | ( | ) | const |
获取当前文件操作的错误码
以右值引用的方式进行赋值操作
| [in] | other | 原始对象 |
| DExpected< Permissions > DFileInfo::permissions | ( | ) | const |
获取当前文件的权限属性
| DFileFuture * DFileInfo::permissionsAsync | ( | int | ioPriority, |
| QObject * | parent = nullptr |
||
| ) |
异步的方式获取文件权限属性
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| DExpected< QByteArray > DFileInfo::queryAttributes | ( | ) | const |
获取已定义的查询属性
| DExpected< FileQueryInfoFlags > DFileInfo::queryInfoFlag | ( | ) | const |
获取已定义的查询信息的标志
| DExpected< bool > DFileInfo::refresh | ( | ) |
重新根据查询属性来获取文件信息,应在queryAttributes发生变动后调用
| DFileFuture * DFileInfo::refreshAsync | ( | int | ioPriority, |
| QObject * | parent = nullptr |
||
| ) |
异步的方式刷新文件信息
| [in] | ioPriority | 优先级控制 |
| [in] | parent | 默认为空 |
| void DFileInfo::setQueryAttributes | ( | const QByteArray & | attributes | ) |
设置查询属性
| [in] | attributes | 要设置的属性 |
| void DFileInfo::setQueryInfoFlags | ( | const FileQueryInfoFlags | flags | ) |
设置查询文件信息时的标志
| [in] | flags | 标志(不进行额外操作 | 不处理链接文件) |
| DExpected< QUrl > DFileInfo::url | ( | ) | const |
获取当前对象管理的文件的url字符串