This class subscribes to notifications of file system changes, thus it can be used to efficiently stay informed about changes in a directory tree.
Definition at line 28 of file CFileSystemWatcher.h.
#include <mrpt/system/CFileSystemWatcher.h>
Classes | |
struct | TFileSystemChange |
Each of the changes detected by utils::CFileSystemWatcher. More... | |
Public Types | |
typedef std::deque< TFileSystemChange > | TFileSystemChangeList |
Public Member Functions | |
CFileSystemWatcher (const std::string &path) | |
Creates the subscription to a specified path. More... | |
virtual | ~CFileSystemWatcher () |
Destructor. More... | |
void | getChanges (TFileSystemChangeList &out_list) |
Call this method sometimes to get the list of changes in the watched directory. More... | |
Private Attributes | |
std::string | m_watchedDirectory |
Ended in "/". More... | |
typedef std::deque<TFileSystemChange> mrpt::system::CFileSystemWatcher::TFileSystemChangeList |
Definition at line 53 of file CFileSystemWatcher.h.
CFileSystemWatcher::CFileSystemWatcher | ( | const std::string & | path | ) |
Creates the subscription to a specified path.
path | The file or directory to watch. |
Definition at line 41 of file CFileSystemWatcher.cpp.
References ASSERT_, mrpt::system::createThreadFromObjectMethod(), m_watchedDirectory, MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 97 of file CFileSystemWatcher.cpp.
References mrpt::system::terminateThread().
void CFileSystemWatcher::getChanges | ( | TFileSystemChangeList & | out_list | ) |
Call this method sometimes to get the list of changes in the watched directory.
Definition at line 126 of file CFileSystemWatcher.cpp.
References ASSERTMSG_, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventAccessed, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventCloseWrite, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventCreated, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventDeleted, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventModified, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventMovedFrom, mrpt::system::CFileSystemWatcher::TFileSystemChange::eventMovedTo, mrpt::system::CFileSystemWatcher::TFileSystemChange::isDir, m_watchedDirectory, mrpt::system::os::memcpy(), and mrpt::system::CFileSystemWatcher::TFileSystemChange::path.
|
private |
Ended in "/".
Definition at line 70 of file CFileSystemWatcher.h.
Referenced by CFileSystemWatcher(), and getChanges().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |