Lysa  0.0
Lysa 3D Engine
DirectoryWatcher Class Reference

Detailed Description

Monitors a directory for changes and emits events when its content is modified.

Public Member Functions

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

Constructor & Destructor Documentation

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

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 ( const VirtualFS fs,
const std::string &  uri,
uint32  debounceTimer = 100 
)

Creates a DirectoryWatcher and starts it.

Parameters
fsThe virtual file system resolving the URI.
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.