Monitor one or more directories for changes in their files.
The file watcher class will monitor one or more directories for changes and will signal any defined slots when that resource has been modified, removed, or created. The notification method is very fast and does not use polling, but does require the user to make a quick check for the notification.
#include <utility/YiFileWatcher.h>
Public Member Functions | |
| CYIFileWatcher () | |
| ~CYIFileWatcher () | |
| YI_FILEWATCHID | AddWatch (const CYIString &filePath) |
| void | RemoveWatch (YI_FILEWATCHID id) |
| void | UpdateAsyncHandler () |
Public Attributes | |
| CYISignal< const CYIString & > | Modified |
| CYISignal< const CYIString & > | Deleted |
| CYISignal< const CYIString & > | Created |
| CYIFileWatcher::CYIFileWatcher | ( | ) |
Default constructor.
| CYIFileWatcher::~CYIFileWatcher | ( | ) |
Destructor.
| YI_FILEWATCHID CYIFileWatcher::AddWatch | ( | const CYIString & | filePath | ) |
Adds a file watch for the given file path and returns a file watch id, which is a unique number that refers to the watched file or directory.
| void CYIFileWatcher::RemoveWatch | ( | YI_FILEWATCHID | id | ) |
Removes the file or directory watch using the file watch id.
| void CYIFileWatcher::UpdateAsyncHandler | ( | ) |
Updates the various system dependent file watch methods. This should be called as often as possible.
This signal is emitted when the watched file or directory has been created.
This signal is emitted when the watched file or directory has been deleted.
This signal is emitted when the watched file or directory has been modified.