libzypp 17.31.23
|
Remember a files attributes to detect content changes. More...
#include <fs/watchfile.h>
Public Types | |
enum | Initial { NO_INIT , INIT } |
Public Member Functions | |
WatchFile (const Pathname &path_r=Pathname(), Initial mode=INIT) | |
WatchFile (Pathname &&path_r, Initial mode=INIT) | |
const Pathname & | path () const |
off_t | lastSize () const |
time_t | lastMtime () const |
bool | isDirty () const |
bool | hasChanged () |
Private Member Functions | |
void | ctorInit (Initial mode) |
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.
Definition at line 61 of file watchfile.h.
|
inline |
Definition at line 65 of file watchfile.h.
|
inline |
Definition at line 68 of file watchfile.h.
|
inline |
Definition at line 71 of file watchfile.h.
|
inline |
Definition at line 74 of file watchfile.h.
|
inline |
Definition at line 80 of file watchfile.h.
|
inlineprivate |
Definition at line 93 of file watchfile.h.
|
private |
Definition at line 101 of file watchfile.h.
|
private |
Definition at line 102 of file watchfile.h.
|
private |
Definition at line 103 of file watchfile.h.