lfilesystem  0.0.1
C++ filesystem library
JSONWatcher Struct Referencefinal
+ Inheritance diagram for JSONWatcher:

Public Member Functions

 JSONWatcher (const limes::files::Directory &dir)
 
void fileCreated (const limes::files::FilesystemEntry &file) final
 Called when a file or subdirectory is created in a watched directory. More...
 
void fileDeleted (const limes::files::FilesystemEntry &file) final
 Called when a file is deleted. More...
 
void fileMoved (const limes::files::FilesystemEntry &file) final
 Called when a file is moved or renamed. More...
 
- Public Member Functions inherited from limes::files::FileWatcher
 FileWatcher () noexcept
 Creates an inactive FileWatcher that does nothing. More...
 
 FileWatcher (const FilesystemEntry &fileToWatch)
 Creates a FileWatcher to watch the given file or directory. More...
 
 FileWatcher (const FileWatcher &)=delete
 
 FileWatcher (FileWatcher &&)=delete
 
virtual ~FileWatcher ()
 Destructor. More...
 
virtual void fileAccessed (const FilesystemEntry &)
 Called when a file's content is accessed. More...
 
virtual void fileHandleClosed (const FilesystemEntry &)
 Called when a file handle is closed (from either reading or writing). More...
 
virtual void fileMetadataChanged (const FilesystemEntry &)
 Called when a file's metadata is changed, such as permissions, owner, etc. More...
 
virtual void fileModified (const FilesystemEntry &)
 Called when a file's content is modified. More...
 
virtual void fileOpened (const FilesystemEntry &)
 Called when a file handle is created (for either reading or writing). More...
 
FilesystemEntry getWatchedPath () const noexcept
 Returns the path that is currently being watched. More...
 
bool isRunning ()
 Returns true if the FilesystemWatcher is currently monitoring events. More...
 
FileWatcheroperator= (const FileWatcher &)=delete
 
FileWatcheroperator= (FileWatcher &&)=delete
 
virtual void otherEventType (const FilesystemEntry &)
 Called when an unspecified event has occurred, such as one of the watched file's parent directories being renamed or deleted. More...
 
bool start ()
 Restarts watching the path specified at construction. More...
 
bool start (const FilesystemEntry &newPathToWatch)
 Begins watching the new specified path. More...
 
void stop ()
 Stops the FilesystemWatcher's event callbacks. More...
 

Public Attributes

const limes::files::Directory directory
 
std::vector< limes::files::FilejsonFiles
 

Additional Inherited Members

- Static Public Member Functions inherited from limes::files::FileWatcher
static bool supportedBySystem () noexcept
 Returns true if the current system supports file event watching. More...
 

Detailed Description

Examples
files_dir_listen.cpp.

Definition at line 18 of file files_dir_listen.cpp.

Member Function Documentation

◆ fileCreated()

void JSONWatcher::fileCreated ( const limes::files::FilesystemEntry )
inlinefinalvirtual

Called when a file or subdirectory is created in a watched directory.

Reimplemented from limes::files::FileWatcher.

Examples
files_dir_listen.cpp.

Definition at line 27 of file files_dir_listen.cpp.

◆ fileDeleted()

void JSONWatcher::fileDeleted ( const limes::files::FilesystemEntry )
inlinefinalvirtual

Called when a file is deleted.

Reimplemented from limes::files::FileWatcher.

Examples
files_dir_listen.cpp.

Definition at line 39 of file files_dir_listen.cpp.

◆ fileMoved()

void JSONWatcher::fileMoved ( const limes::files::FilesystemEntry )
inlinefinalvirtual

Called when a file is moved or renamed.

For directories, this will be called if the watched directory contained the file that was moved from or the file that was moved to.

Reimplemented from limes::files::FileWatcher.

Examples
files_dir_listen.cpp.

Definition at line 48 of file files_dir_listen.cpp.


The documentation for this struct was generated from the following file: