siplasplas
A library for C++ reflection and introspection
cpp::FileSystemListener Class Reference

File system listener class that notifies filesystem changed through signals. More...

#include <siplasplas/fswatch/fslistener.hpp>

Inheritance diagram for cpp::FileSystemListener:
cpp::SignalEmitter

Public Member Functions

void fileCreated (efsw::WatchID watchId, const std::string &dir, const std::string &fileName)
 Signal emitted whenever a file/directory is created. More...
 
void fileDeleted (efsw::WatchID watchId, const std::string &dir, const std::string &fileName)
 Signal emitted whenever a file/directory is deleted. More...
 
void fileModified (efsw::WatchID watchId, const std::string &dir, const std::string &fileName)
 Signal emitted whenever a file/directory is modified. More...
 
void fileMoved (efsw::WatchID watchId, const std::string &dir, const std::string &oldFilename, const std::string &newFileName)
 Signal emitted whenever a file/directory is moved. More...
 
- Public Member Functions inherited from cpp::SignalEmitter
 SignalEmitter (SignalEmitter &&)=default
 
SignalEmitteroperator= (SignalEmitter &&)=default
 
void poll ()
 Polls this object for incomming signal emissions. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cpp::SignalEmitter
template<typename Caller , typename Function , typename R , typename Class , typename... Args>
static std::shared_ptr< const SignalSinkconnect (Caller &caller, R(Class::*source)(Args...), Function function)
 Creates a direct connection from the given emitter object to the given function. More...
 
template<typename Caller , typename Callee , typename Function , typename R , typename Class , typename... Args>
static std::shared_ptr< const SignalSinkconnect (Caller &caller, R(Class::*source)(Args...), Callee &callee, Function function)
 Creates a direct connection from the given emitter object to the given function, using an specific callee object. More...
 
template<typename Caller , typename Function , typename R , typename Class , typename... Args>
static std::shared_ptr< const SignalSinkconnect_async (Caller &caller, R(Class::*source)(Args...), Function function)
 Creates an asynchronous connection between a signal and a function. More...
 
template<typename Caller , typename Callee , typename Function , typename R , typename Class , typename... Args>
static std::shared_ptr< const SignalSinkconnect_async (Caller &caller, R(Class::*source)(Args...), Callee &callee, Function function)
 Creates an asynchronous connection between a signal and a function using an specific callee object. More...
 
template<typename Caller , typename Callee , typename R , typename... Args>
static std::shared_ptr< const SignalSinkbypass (Caller &caller, R(Caller::*source)(Args...), Callee &callee, R(Callee::*dest)(Args...))
 Connects two signals synchronously. More...
 
template<typename Caller , typename Callee , typename R , typename... Args>
static std::shared_ptr< const SignalSinkbypass_async (Caller &caller, R(Caller::*source)(Args...), Callee &callee, R(Callee::*dest)(Args...))
 Connects two signals asynchronously. More...
 
template<typename Class , typename R , typename... FArgs, typename... Args>
static void emit (Class &emitter, R(Class::*function)(FArgs...), Args &&...args)
 Emits a signal on the given emitter. More...
 
- Protected Member Functions inherited from cpp::SignalEmitter
template<typename Function , typename... Args>
void invoke (Function function, Args &&...args)
 

Detailed Description

File system listener class that notifies filesystem changed through signals.

FileSystemListener is a wrapper of an [Euforia Filesystem Watcher]() filesystem listener that uses siplasplas signals to notify changes on the file system, using a different signal for each change type (File created, file modified, etc). The class implements the efsw::FileWatchListener interface, and can be passed as listener for efsw watchers. The signals are raised from the background thread the filesystem watcher is running.

Examples:
fswatch/fswatch.cpp.

Member Function Documentation

void cpp::FileSystemListener::fileCreated ( efsw::WatchID  watchId,
const std::string &  dir,
const std::string &  fileName 
)
inline

Signal emitted whenever a file/directory is created.

Parameters
watchIdID of the watch the event comes from.
dirbase directory of the entity (file or directory) that raised the event.
fileNameFilename of the entity that raised the event.
Examples:
fswatch/fswatch.cpp.
void cpp::FileSystemListener::fileDeleted ( efsw::WatchID  watchId,
const std::string &  dir,
const std::string &  fileName 
)
inline

Signal emitted whenever a file/directory is deleted.

Parameters
watchIdID of the watch the event comes from.
dirbase directory of the entity (file or directory) that raised the event.
fileNameFilename of the entity that raised the event.
Examples:
fswatch/fswatch.cpp.
void cpp::FileSystemListener::fileModified ( efsw::WatchID  watchId,
const std::string &  dir,
const std::string &  fileName 
)
inline

Signal emitted whenever a file/directory is modified.

Parameters
watchIdID of the watch the event comes from.
dirbase directory of the entity (file or directory) that raised the event.
fileNameFilename of the entity that raised the event.
Examples:
fswatch/fswatch.cpp.
void cpp::FileSystemListener::fileMoved ( efsw::WatchID  watchId,
const std::string &  dir,
const std::string &  oldFilename,
const std::string &  newFileName 
)
inline

Signal emitted whenever a file/directory is moved.

Parameters
watchIdID of the watch the event comes from.
dirbase directory of the entity (file or directory) that raised the event.
oldFIlenameOld name of the directory/file.
newFIlenameNew name of the directory/file.
Examples:
fswatch/fswatch.cpp.

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