![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <DirectoryWatcher.hpp>
Classes | |
struct | Info |
Public Types | |
typedef std::function< void(Info)> | EventCallback |
Public Member Functions | |
DirectoryWatcher () | |
Constructor. More... | |
DirectoryWatcher (const std::string &dir, EventCallback callback) | |
Overloaded constructor. More... | |
~DirectoryWatcher () | |
Destructor. More... | |
bool | start (const std::string &dir, EventCallback callback) |
Start watching a directory. More... | |
void | stop () |
Stop watching a directory. More... | |
void | setActive (const bool active) |
Set this watcher active/inactive. More... | |
bool | isActive () const |
Check if this watcher is active. More... | |
bool | hasError () const |
Check if this watcher is in an error condition. More... | |
Definition at line 41 of file DirectoryWatcher.hpp.
typedef std::function<void(Info)> jop::DirectoryWatcher::EventCallback |
File change event callback
Definition at line 67 of file DirectoryWatcher.hpp.
jop::DirectoryWatcher::DirectoryWatcher | ( | ) |
Constructor.
Won't start observing any directory.
jop::DirectoryWatcher::DirectoryWatcher | ( | const std::string & | dir, |
EventCallback | callback | ||
) |
Overloaded constructor.
Calls start() with the given arguments.
dir | The directory to start watching |
callback | The event callback |
jop::DirectoryWatcher::~DirectoryWatcher | ( | ) |
Destructor.
bool jop::DirectoryWatcher::hasError | ( | ) | const |
Check if this watcher is in an error condition.
bool jop::DirectoryWatcher::isActive | ( | ) | const |
Check if this watcher is active.
void jop::DirectoryWatcher::setActive | ( | const bool | active | ) |
Set this watcher active/inactive.
active | True to set active |
bool jop::DirectoryWatcher::start | ( | const std::string & | dir, |
EventCallback | callback | ||
) |
Start watching a directory.
Calls stop() before opening the new directory.
dir | The directory to start watching |
callback | The event callback |
void jop::DirectoryWatcher::stop | ( | ) |
Stop watching a directory.