X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=common%2Ffilesystem_monitor.h;h=c44662d292e6bda3ec0822ce6a73075fe97a5211;hb=536d93d974051e67bc306c462173fd02579b91d3;hp=c69b4f3f639520380e77aa97605a31f248cbb345;hpb=ad66cff9a6a3d35e4765c9ab4289ed0976d52c7b;p=casparcg diff --git a/common/filesystem_monitor.h b/common/filesystem_monitor.h index c69b4f3f6..c44662d29 100644 --- a/common/filesystem_monitor.h +++ b/common/filesystem_monitor.h @@ -26,9 +26,10 @@ #include #include -#include #include "memory.h" +#include "future_fwd.h" +#include "enum_class.h" namespace caspar { @@ -46,7 +47,7 @@ public: * @return a future made available when the initially available files have been * processed. */ - virtual boost::unique_future initial_files_processed() = 0; + virtual std::future initial_files_processed() = 0; /** * Reemmit the already known files as MODIFIED events. @@ -58,13 +59,13 @@ public: * * @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, @@ -72,6 +73,7 @@ enum filesystem_event // 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. @@ -81,7 +83,7 @@ enum filesystem_event * @param event Can be CREATED, REMOVED or MODIFIED. * @param file The file affected. */ -typedef std::function filesystem_monitor_handler; +typedef std::function filesystem_monitor_handler; /** * Called when the initially available files has been found. @@ -90,7 +92,7 @@ typedef std::function& initial_files)> initial_files_handler; +typedef std::function& initial_files)> initial_files_handler; /** * Factory for creating filesystem monitors. @@ -118,12 +120,12 @@ public: * @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&) { }) = 0; + [] (const std::set&) { }) = 0; }; -} \ No newline at end of file +}