#include <boost/filesystem.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
#include "memory.h"
+#include "future_fwd.h"
+#include "enum_class.h"
namespace caspar {
* @return a future made available when the initially available files have been
* processed.
*/
- virtual boost::unique_future<void> initial_files_processed() = 0;
+ virtual std::future<void> initial_files_processed() = 0;
/**
* Reemmit the already known files as MODIFIED events.
*
* @param file The file to reemmit.
*/
- virtual void reemmit(const boost::filesystem::wpath& file) = 0;
+ virtual void reemmit(const boost::filesystem::path& file) = 0;
};
/**
* The possible filesystem events.
*/
-enum filesystem_event
+enum class filesystem_event
{
CREATED = 1,
REMOVED = 2,
// Only used for describing a bitmask where all events are wanted. Never used when calling a handler.
ALL = 7
};
+ENUM_ENABLE_BITWISE(filesystem_event);
/**
* Handles filesystem events.
* @param event Can be CREATED, REMOVED or MODIFIED.
* @param file The file affected.
*/
-typedef std::function<void (filesystem_event event, const boost::filesystem::wpath& file)> filesystem_monitor_handler;
+typedef std::function<void (filesystem_event event, const boost::filesystem::path& file)> filesystem_monitor_handler;
/**
* Called when the initially available files has been found.
*
* @param initial_files The files that were initially available.
*/
-typedef std::function<void (const std::set<boost::filesystem::wpath>& initial_files)> initial_files_handler;
+typedef std::function<void (const std::set<boost::filesystem::path>& initial_files)> initial_files_handler;
/**
* Factory for creating filesystem monitors.
* @return The filesystem monitor handle.
*/
virtual filesystem_monitor::ptr create(
- const boost::filesystem::wpath& folder_to_watch,
+ const boost::filesystem::path& folder_to_watch,
filesystem_event events_of_interest_mask,
bool report_already_existing,
const filesystem_monitor_handler& handler,
const initial_files_handler& initial_files_handler =
- [] (const std::set<boost::filesystem::wpath>&) { }) = 0;
+ [] (const std::set<boost::filesystem::path>&) { }) = 0;
};
-}
\ No newline at end of file
+}