Lysa  0.0
Lysa 3D Engine
DirectoryWatcher Class Reference

Detailed Description

Monitors a directory for changes and emits events when files are modified.

This class runs a background thread that uses OS-specific APIs to watch for file changes. A DirectoryWatcherEvent::FILE_CHANGED event is emmitted when a file of the directory is modified.

Public Member Functions

 DirectoryWatcher (const std::string &uri, uint32 debounceTimer=100)
 
 ~DirectoryWatcher ()
 
void start ()
 
void stop () noexcept
 

Constructor & Destructor Documentation

DirectoryWatcher ( const std::string &  uri,
uint32  debounceTimer = 100 
)

Creates a DirectoryWatcher and starts it.

Parameters
uriThe URI of the directory to watch.
debounceTimerThe time to wait (in milliseconds) before emitting an event after a change is detected for the same file as the previous detected change.
~DirectoryWatcher ( )

Stop then estroy a DirectoryWatcher.

Member Function Documentation

void start ( )

Starts the background thread to watch the directory.

void stop ( )
noexcept

Stops the background thread and releases resources.