#include <PathWatcher.hpp>
Public Slots | |
void | checkFile () |
periodically check for changes More... | |
void | directoryChanged (const QString &path) |
called when file/directory is added or removed or when directory is removed More... | |
void | fileChanged (const QString &path) |
called when file is modified or removed More... | |
Public Member Functions | |
void | clearState () |
reset state to clean More... | |
bool | dirty () const |
true if path has been changed More... | |
bool | disable () |
void | enable () |
enable the watcher More... | |
bool | enabled () const |
is the watcher currently enabled More... | |
virtual void | onPathAdded () |
for files, called when watched file is added if watcher enabled More... | |
virtual void | onPathChanged () |
for files, called when watched file is modified if watcher enabled for directories, called when file/directory is added or removed to the watched directory if watcher enabled More... | |
virtual void | onPathRemoved () |
for files, called when watched file is removed if watcher enabled for directories, called when the watched directory is removed if watcher enabled More... | |
openstudio::path | path () const |
path that is being watched More... | |
PathWatcher (const openstudio::path &p, int msec=1000) | |
constructor with path More... | |
virtual | ~PathWatcher () |
virtual destructor More... | |
Class for watching either a file or directory, QFileSystemWatcher has issues when watching many files so it is not recommended to use too many of these objects.
openstudio::PathWatcher::PathWatcher | ( | const openstudio::path & | p, |
int | msec = 1000 |
||
) |
constructor with path
if path is a directory it must exist at time of construction, no periodic checks are performed for directory if path is not a directory it is assumed to be a regular file which may or may not exist at construction, a timer is used to periodically check for changes to the file msec is the timer delay to check for updates to the file, msec does not apply if the path is a directory
|
virtual |
virtual destructor
|
slot |
periodically check for changes
void openstudio::PathWatcher::clearState | ( | ) |
reset state to clean
|
slot |
called when file/directory is added or removed or when directory is removed
bool openstudio::PathWatcher::dirty | ( | ) | const |
true if path has been changed
bool openstudio::PathWatcher::disable | ( | ) |
void openstudio::PathWatcher::enable | ( | ) |
enable the watcher
bool openstudio::PathWatcher::enabled | ( | ) | const |
is the watcher currently enabled
|
slot |
called when file is modified or removed
|
virtual |
for files, called when watched file is added if watcher enabled
|
virtual |
for files, called when watched file is modified if watcher enabled for directories, called when file/directory is added or removed to the watched directory if watcher enabled
|
virtual |
for files, called when watched file is removed if watcher enabled for directories, called when the watched directory is removed if watcher enabled
openstudio::path openstudio::PathWatcher::path | ( | ) | const |
path that is being watched