#include <inotify-cxx.h>
Public Member Functions | |
Inotify () throw (InotifyException) | |
Constructor. | |
~Inotify () | |
Destructor. | |
void | Close () |
Removes all watches and closes the inotify device. | |
void | Add (InotifyWatch *pWatch) throw (InotifyException) |
Adds a new watch. | |
void | Add (InotifyWatch &rWatch) throw (InotifyException) |
Adds a new watch. | |
void | Remove (InotifyWatch *pWatch) throw (InotifyException) |
Removes a watch. | |
void | Remove (InotifyWatch &rWatch) throw (InotifyException) |
Removes a watch. | |
void | RemoveAll () |
Removes all watches. | |
size_t | GetWatchCount () const |
Returns the count of watches. | |
void | WaitForEvents (bool fNoIntr=false) throw (InotifyException) |
Waits for inotify events. | |
int | GetEventCount () |
Returns the count of received and queued events. | |
bool | GetEvent (InotifyEvent *pEvt) throw (InotifyException) |
Extracts a queued inotify event. | |
bool | GetEvent (InotifyEvent &rEvt) throw (InotifyException) |
Extracts a queued inotify event. | |
bool | PeekEvent (InotifyEvent *pEvt) throw (InotifyException) |
Extracts a queued inotify event (without removing). | |
bool | PeekEvent (InotifyEvent &rEvt) throw (InotifyException) |
Extracts a queued inotify event (without removing). | |
InotifyWatch * | FindWatch (int iDescriptor) |
Searches for a watch by a watch descriptor. | |
InotifyWatch * | FindWatch (const std::string &rPath) |
Searches for a watch by a filesystem path. | |
int | GetDescriptor () const |
Returns the file descriptor. | |
void | SetNonBlock (bool fNonBlock) throw (InotifyException) |
Enables/disables non-blocking mode. | |
Friends | |
class | InotifyWatch |
|
Constructor. Creates and initializes an instance of inotify communication object (opens the inotify device).
|
|
Destructor. Calls Close() due to clean-up. |
|
Adds a new watch.
|
|
Adds a new watch.
|
|
Removes all watches and closes the inotify device.
|
|
Searches for a watch by a filesystem path. It tries to find a watch by the given filesystem path.
|
|
Searches for a watch by a watch descriptor. It tries to find a watch by the given descriptor.
|
|
Returns the file descriptor. The descriptor can be used in standard low-level file functions (poll(), select(), fcntl() etc.).
|
|
Extracts a queued inotify event. The extracted event is removed from the queue.
|
|
Extracts a queued inotify event. The extracted event is removed from the queue. If the pointer is NULL it does nothing.
|
|
Returns the count of received and queued events. This number is related to the events in the queue inside this object, not to the events pending in the kernel.
|
|
Returns the count of watches. This is the total count of all watches (regardless whether enabled or not).
|
|
Extracts a queued inotify event (without removing). The extracted event stays in the queue.
|
|
Extracts a queued inotify event (without removing). The extracted event stays in the queue. If the pointer is NULL it does nothing.
|
|
Removes a watch. If the given watch is not present it does nothing.
|
|
Removes a watch. If the given watch is not present it does nothing.
|
|
Removes all watches.
|
|
Enables/disables non-blocking mode. Use this mode if you want to monitor the descriptor (acquired thru GetDescriptor()) in functions such as poll(), select() etc.
|
|
Waits for inotify events. It waits until one or more events occur. When called in nonblocking mode it only retrieves occurred events to the internal queue and exits.
|
|
|