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 30 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 63 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_, m_watchedDirectory, MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 90 of file CFileSystemWatcher.cpp.
void CFileSystemWatcher::getChanges | ( | TFileSystemChangeList & | out_list | ) |
Call this method sometimes to get the list of changes in the watched directory.
Definition at line 116 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 82 of file CFileSystemWatcher.h.
Referenced by CFileSystemWatcher(), and getChanges().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |