FileSystemWatcherΒΆ
Inherited: Object
DescriptionΒΆ
FileSystemWatcher allows registering files or directories to be monitored. When a watched file or directory changes, the appropriate signal (fileChanged or directoryChanged) is emitted.
Public MethodsΒΆ
bool |
addPath (const TString & path) |
bool |
addPaths (const StringList & paths) |
StringList |
directories () const |
void |
directoryChanged (const TString & path) |
void |
fileChanged (const TString & path) |
StringList |
files () const |
bool |
removePath (const TString & path) |
bool |
removePaths (const StringList & paths) |
Static MethodsΒΆ
None
Methods DescriptionΒΆ
bool FileSystemWatcher::addPath (TString & path)
Add a single path to the watch list (file or directory).
Returns true if the path exists and was added (or already present).
bool FileSystemWatcher::addPaths (StringList & paths)
Add multiple paths to be watched.
Attempts to add each path and returns true only if all additions succeed.
StringList FileSystemWatcher::directories () const
Return a list of currently watched directories.
void FileSystemWatcher::directoryChanged (TString & path)
Emit the directoryChanged signal for the given directory path.
void FileSystemWatcher::fileChanged (TString & path)
Emit the fileChanged signal for the given path.
StringList FileSystemWatcher::files () const
Return a list of currently watched files.
bool FileSystemWatcher::removePath (TString & path)
Remove a single watched path.
Returns true if the path was being watched and was removed.
bool FileSystemWatcher::removePaths (StringList & paths)
Remove multiple watched paths. Returns true if all paths were being watched and were removed; otherwise returns false.