PFileWatcher Class Reference

Detailed Description

The PFileWatcher class allows monitoring files for changes (listeners are notified each time the specified file is modified).

Definition at line 32 of file PFileWatcher.h.

#include <PFileWatcher.h>

Constructor & Destructor Documentation

◆ PFileWatcher() [1/2]

PFileWatcher::PFileWatcher ( const PString filename = PString::Empty(),
papillon::int32  watchTimeMs = 1000 
)

Constructs a file watcher for the specified file.

Watch time is set to 1 second, by default.

◆ PFileWatcher() [2/2]

PFileWatcher::PFileWatcher ( const PFileWatcher other)

Constructs a shared copy of other.

◆ ~PFileWatcher()

virtual PFileWatcher::~PFileWatcher ( )
virtual

Destroys this object.

Member Function Documentation

◆ AddListener()

void PFileWatcher::AddListener ( PCallback_FileChanged  callback)

Adds the specified listener.

This listener will be notified each time a change occurs on the watched file.

◆ operator=()

PFileWatcher& PFileWatcher::operator= ( const PFileWatcher other)

Performs a shared copy of other to this object.

◆ operator==()

bool PFileWatcher::operator== ( const PFileWatcher other) const

Returns true if this object is the same instance than other, false otherwise.

◆ RemoveListener()

void PFileWatcher::RemoveListener ( PCallback_FileChanged  callback)

Removes the specified listener.

◆ SetFilename()

void PFileWatcher::SetFilename ( PString filename)

Set file to be watched.

◆ SetPeriodMs()

void PFileWatcher::SetPeriodMs ( papillon::int32  watchTimeMs)

Set the watch time period in milliseconds.