Public Member Functions | Protected Member Functions

zeus::TFileSystemWatcher Class Reference

#include <FileSystemWatcher.h>

Inheritance diagram for zeus::TFileSystemWatcher:
zeus::TZObject zeus::IRunnable zeus::ISubject zeus::IZUnknown zeus::IZUnknown zeus::IZUnknown

List of all members.

Public Member Functions

 TFileSystemWatcher (const IString &rPath, bool bIncludeSubTree=true)
void start ()
void stop ()
bool isStarted () const
void reset ()
TString getWatchedPath () const
virtual Retval MQUALIFIER attach (IObserver &rObserver)
virtual Retval MQUALIFIER detach (IObserver &rObserver)
virtual Retval MQUALIFIER askForInterface (const InterfaceID &rInterfaceID, IZUnknown *&rpIface)
virtual void MQUALIFIER addRef () const
virtual void MQUALIFIER release () const

Protected Member Functions

virtual ~TFileSystemWatcher ()
virtual void MQUALIFIER execute ()
virtual void onFileCreated (const IString &rFileName)
virtual void onFileRemoved (const IString &rFileName)
virtual void onFileChanged (const IString &rFileName)
virtual void onFileRenamed (const IString &rOldFileName, const IString &rNewFileName)
virtual void onUnknownAction (const IString &rFileName)

Detailed Description

This class watches a file system and generates call backs. The call backs are posted using a communication pipe


Constructor & Destructor Documentation

TFileSystemWatcher::TFileSystemWatcher ( const IString rPath,
bool  bIncludeSubTree = true 
)

Creates a file system watcher

Parameters:
rPath: Name of the directory
bIncludeSubTree: flag if the watcher also watches the sub structure
TFileSystemWatcher::~TFileSystemWatcher (  ) [protected, virtual]

Destroys the file system watcher


Member Function Documentation

virtual void MQUALIFIER zeus::TFileSystemWatcher::addRef (  ) const [virtual]
See also:
IZUnknown::addRef

Reimplemented from zeus::TZObject.

virtual Retval MQUALIFIER zeus::TFileSystemWatcher::askForInterface ( const InterfaceID rInterfaceID,
IZUnknown *&  rpIface 
) [virtual]
See also:
IZUnknown::askForInterface

Reimplemented from zeus::TZObject.

Retval MQUALIFIER TFileSystemWatcher::attach ( IObserver rObserver ) [virtual]
See also:
ISubject::attach

Implements zeus::ISubject.

Retval MQUALIFIER TFileSystemWatcher::detach ( IObserver rObserver ) [virtual]
See also:
ISubject::detach

Implements zeus::ISubject.

void MQUALIFIER TFileSystemWatcher::execute (  ) [protected, virtual]
See also:
IRunnable::execute

Implements zeus::IRunnable.

TString zeus::TFileSystemWatcher::getWatchedPath (  ) const [inline]

Returns the path of the file system watcher

bool zeus::TFileSystemWatcher::isStarted (  ) const [inline]

Checks if the watcher has been started

void TFileSystemWatcher::onFileChanged ( const IString rFileName ) [protected, virtual]

Callback if a file has been changed

Parameters:
rFileName: Name of the file
void TFileSystemWatcher::onFileCreated ( const IString rFileName ) [protected, virtual]

Callback if a file has been created

Parameters:
rFileName: Name of the file
void TFileSystemWatcher::onFileRemoved ( const IString rFileName ) [protected, virtual]

Callback if a file has been deleted

Parameters:
rFileName: Name of the file
void TFileSystemWatcher::onFileRenamed ( const IString rOldFileName,
const IString rNewFileName 
) [protected, virtual]

Callback if a file has been renamed

Parameters:
rOldFileName: old file name
rNewFileName: new file name
void TFileSystemWatcher::onUnknownAction ( const IString rFileName ) [protected, virtual]

Unknown action on file

Parameters:
rFileName: Name of the file
virtual void MQUALIFIER zeus::TFileSystemWatcher::release (  ) const [virtual]
See also:
IZUnknown::release

Reimplemented from zeus::TZObject.

void TFileSystemWatcher::reset (  )

Resets the file system watcher. All files are posted to the observers

void TFileSystemWatcher::start (  )

Starts the file watching process

void TFileSystemWatcher::stop (  )

Stopps the file watching process


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:34