Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::FileSystemWatcher::FolderWatcher Struct Reference

Represents a single folder being watched. More...

#include <FileSystemWatcher.h>

Public Member Functions

 FolderWatcher (Span< char > subFolderRelativePathsBuffer={})
 Constructs a folder watcher.
 
Result stopWatching ()
 Stop watching this directory.
 
void setDebugName (const char *debugName)
 Sets debug name for AsyncFilePoll used on Windows (used only for debug purposes)
 

Public Attributes

Function< void(const Notification &)> notifyCallback
 Function that will be called on a notification.
 

Friends

struct FileSystemWatcher
 
struct FileSystemWatcherAsync
 

Detailed Description

Represents a single folder being watched.

While in use, the address of this object must not change, as it's inserted in a linked list.

Note
You can create an SC::ArenaMap to create a buffer of these objects, that can be easily reused.

Constructor & Destructor Documentation

◆ FolderWatcher()

SC::FileSystemWatcher::FolderWatcher::FolderWatcher ( Span< char > subFolderRelativePathsBuffer = {})

Constructs a folder watcher.

Parameters
subFolderRelativePathsBufferUser provided buffer used to sub-folders relative paths. When an empty span is passed, the internal 1Kb buffer is used. This buffer is used on Linux only when watching folders recursively, it's unused on Windows / macOS.

Member Function Documentation

◆ setDebugName()

void SC::FileSystemWatcher::FolderWatcher::setDebugName ( const char * debugName)

Sets debug name for AsyncFilePoll used on Windows (used only for debug purposes)

◆ stopWatching()

Result SC::FileSystemWatcher::FolderWatcher::stopWatching ( )

Stop watching this directory.

After calling it the FolderWatcher can be reused or released.

Returns
Valid result if directory was unwatched successfully.

Member Data Documentation

◆ notifyCallback

Function<void(const Notification&)> SC::FileSystemWatcher::FolderWatcher::notifyCallback

Function that will be called on a notification.


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