DtkCore
DTK Core module
Dtk::Core::DBaseFileWatcher类 参考

The DBaseFileWatcher class provides an interface for monitoring files and directories for modifications. 更多...

类 Dtk::Core::DBaseFileWatcher 继承关系图:
Dtk::Core::DObject Dtk::Core::DFileWatcher

Public 类型

using SignalType1 = void(DBaseFileWatcher::*)(const QUrl &)
 
using SignalType2 = void(DBaseFileWatcher::*)(const QUrl &, const QUrl &)
 

信号

void fileDeleted (const QUrl &url)
 
void fileAttributeChanged (const QUrl &url)
 
void fileMoved (const QUrl &fromUrl, const QUrl &toUrl)
 
void subfileCreated (const QUrl &url)
 
void fileModified (const QUrl &url)
 
void fileClosed (const QUrl &url)
 

Public 成员函数

QUrl fileUrl () const
 
bool startWatcher ()
 开始文件变动监视 更多...
 
bool stopWatcher ()
 停止文件变动监视. 更多...
 
bool restartWatcher ()
 重新开始文件变动监视. 更多...
 
virtual void setEnabledSubfileWatcher (const QUrl &subfileUrl, bool enabled=true)
 设置是否对 subfileUrl 目录启用文件监视 更多...
 

静态 Public 成员函数

static bool ghostSignal (const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1)
 发送一个信号表示目标目录 targetUrl 得到了一个 signal 信号,包含参数 arg1更多...
 
static bool ghostSignal (const QUrl &targetUrl, SignalType2 signal, const QUrl &arg1, const QUrl &arg2)
 发送一个信号表示目标目录 targetUrl 得到了一个 signal 信号,包含参数 arg1 和 arg2。 更多...
 

Protected 成员函数

 DBaseFileWatcher (DBaseFileWatcherPrivate &dd, const QUrl &url, QObject *parent=0)
 
- Protected 成员函数 继承自 Dtk::Core::DObject
 DObject (DObject *parent=nullptr)
 只有在不需要数据成员的派生类中才会使用 parent 父类指针
 
 DObject (DObjectPrivate &dd, DObject *parent=nullptr)
 在派生类中比较常用的构造函数 dd 私有类对象
 

额外继承的成员函数

- Protected 属性 继承自 Dtk::Core::DObject
QScopedPointer< DObjectPrivated_d_ptr
 

详细描述

The DBaseFileWatcher class provides an interface for monitoring files and directories for modifications.

\inmodule dtkcore

DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。

成员函数说明

◆ ghostSignal() [1/2]

bool Dtk::Core::DBaseFileWatcher::ghostSignal ( const QUrl &  targetUrl,
DBaseFileWatcher::SignalType1  signal,
const QUrl &  arg1 
)
static

发送一个信号表示目标目录 targetUrl 得到了一个 signal 信号,包含参数 arg1

Emit a signal about targetUrl got a signal with arg1

示例用法: Example usage:

DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileDeleted, QUrl("bookmark:///bookmarkFile1"));
static bool ghostSignal(const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1)
发送一个信号表示目标目录 targetUrl 得到了一个 signal 信号,包含参数 arg1 。
Definition: dbasefilewatcher.cpp:142
返回
成功发送返回 true,否则返回 false.

◆ ghostSignal() [2/2]

bool Dtk::Core::DBaseFileWatcher::ghostSignal ( const QUrl &  targetUrl,
DBaseFileWatcher::SignalType2  signal,
const QUrl &  arg1,
const QUrl &  arg2 
)
static

发送一个信号表示目标目录 targetUrl 得到了一个 signal 信号,包含参数 arg1 和 arg2。

Emit a signal about targetUrl got a signal with arg1 and arg2

示例用法: Example usage:

DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileMoved, QUrl("bookmark:///bookmarkFile1"), QUrl("bookmark:///NewNameFile1"));

◆ restartWatcher()

bool Dtk::Core::DBaseFileWatcher::restartWatcher ( )

重新开始文件变动监视.

Stop file watcher and then restart it to watching file changes.

返回
成功开启返回 true,否则返回 false.
参见
startWatcher(), stopWatcher()

◆ setEnabledSubfileWatcher()

void Dtk::Core::DBaseFileWatcher::setEnabledSubfileWatcher ( const QUrl &  subfileUrl,
bool  enabled = true 
)
virtual

设置是否对 subfileUrl 目录启用文件监视

Set enable file watcher for subfileUrl or not

subfileUrl 设置所针对的 Url subfileUrl The given url

enabled 是否启用文件变动监视 enabled Enable file change watching or not.

◆ startWatcher()

bool Dtk::Core::DBaseFileWatcher::startWatcher ( )

开始文件变动监视

Let file watcher start watching file changes.

返回
成功开始返回 true ,否则返回 false.
参见
stopWatcher(), restartWatcher()

◆ stopWatcher()

bool Dtk::Core::DBaseFileWatcher::stopWatcher ( )

停止文件变动监视.

Stop watching file changes.

返回
成功停止返回 true ,否则返回 false.
参见
startWatcher(), restartWatcher()

该类的文档由以下文件生成: