libzypp
13.10.6
|
Remember a files attributes to detect content changes. More...
#include <WatchFile.h>
Public Types | |
enum | Initial { NO_INIT, INIT } |
Public Member Functions | |
WatchFile (const Pathname &path_r=Pathname(), Initial mode=INIT) | |
const Pathname & | path () const |
bool | hasChanged () |
Private Attributes | |
Pathname | _path |
off_t | _size |
time_t | _mtime |
Remember a files attributes to detect content changes.
Repeatedly call hasChanged to check whether the content has changed since the last call. Creation or deletion of the file will be reported as change as well.
Per default the ctor stats the file, so hasChanged will detect changes done after WatchFile was created.
You may omit the initial stat by passing NO_INIT
as second argument to the ctor. WatchFile will behave as if the file did not exist at the time WatchFile was created.
Definition at line 49 of file WatchFile.h.
Enumerator | |
---|---|
NO_INIT | |
INIT |
Definition at line 52 of file WatchFile.h.
Definition at line 56 of file WatchFile.h.
|
inline |
Definition at line 65 of file WatchFile.h.
|
inline |
Definition at line 68 of file WatchFile.h.
|
private |
Definition at line 81 of file WatchFile.h.
|
private |
Definition at line 82 of file WatchFile.h.
|
private |
Definition at line 83 of file WatchFile.h.