Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::system::FileNotifier Class Reference

File Change Monitor. More...

#include <FileNotifier.h>

Public Types

using Ptr = std::unique_ptr<FileNotifier>
 

Public Member Functions

virtual ~FileNotifier () noexcept
 
void loopNonblocking () noexcept
 Start a thread to start processing the change event.
 
void shutdown () noexcept
 Shut down the monitor and block until the background thread exits.
 

Static Public Member Functions

static FileNotifier::Ptr create (const std::string &path, FileNotifyOption *option) noexcept
 
static Result< Ptr, ErrorCodecreateEx (const std::string &path, FileNotifyOption *option) noexcept
 

Private Member Functions

 FileNotifier ()=default
 

Detailed Description

File Change Monitor.

Bug
This implementation has an inconsistent event order in Darwin compared to Windows and Linux.

In Darwin, multiple events for the same file are triggered first, while in Windows and Linux, events are triggered in chronological order.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ~FileNotifier()

FileNotifier::~FileNotifier ( )
virtualnoexcept

References shutdown().

◆ FileNotifier()

sese::system::FileNotifier::FileNotifier ( )
privatedefault

Member Function Documentation

◆ create()

FileNotifier::Ptr FileNotifier::create ( const std::string & path,
FileNotifyOption * option )
staticnoexcept

Create file monitor

Parameters
pathThe path to the [directory]
optionCallback options
Return values
nullptrCreation failed

References callback(), and MAKE_UNIQUE_PRIVATE.

◆ createEx()

static Result< Ptr, ErrorCode > sese::system::FileNotifier::createEx ( const std::string & path,
FileNotifyOption * option )
staticnoexcept

◆ loopNonblocking()

void FileNotifier::loopNonblocking ( )
noexcept

Start a thread to start processing the change event.

◆ shutdown()

void FileNotifier::shutdown ( )
noexcept

Shut down the monitor and block until the background thread exits.

Referenced by ~FileNotifier().


The documentation for this class was generated from the following files: