23#ifndef FILESYSTEMWATCHER_H 
   24#define FILESYSTEMWATCHER_H 
   35#elif defined(__APPLE__) 
   36#include <CoreServices/CoreServices.h> 
   63        const std::filesystem::path& 
getPath() const noexcept;
 
  108        void watch() noexcept;
 
  109        std::thread m_watchThread;
 
  110        mutable std::mutex m_mutex;
 
  111        std::filesystem::path m_path;
 
  112        bool m_includeSubdirectories;
 
  116        std::vector<std::filesystem::path> m_extensionFilters;
 
  118        HANDLE m_terminateEvent;
 
  119#elif defined(__linux__) 
  121#elif defined(__APPLE__) 
  122        static void callback(ConstFSEventStreamRef stream, 
void* clientCallBackInfo, 
size_t numEvents, 
void* eventPaths, 
const FSEventStreamEventFlags eventFlags[], 
const FSEventStreamEventId eventIds[]) 
noexcept;
 
  123        FSEventStreamRef m_stream;
 
  124        CFRunLoopRef m_runLoop;
 
 
An event argument for when a file system object is changed.
Definition filesystemchangedeventargs.h:36
 
bool addExtensionFilter(const std::filesystem::path &extension) noexcept
Adds an extension of a file to watch for changes in the folder.
 
bool clearExtensionFilters() noexcept
Clears all watched extension filters. This will cause all extensions to be implicitly watched.
 
bool getIncludeSubdirectories() const noexcept
Gets whether or not subdirectories of the folder are watched.
 
Events::Event< FileSystemChangedEventArgs > & changed() noexcept
Gets the event for when a watched flag of the folder is changed.
 
WatcherFlags getWatcherFlags() const noexcept
Gets the flags of what to watch changes for.
 
bool removeExtensionFilter(const std::filesystem::path &extension) noexcept
Removes an extension of a file to watch for changes in the folder.
 
~FileSystemWatcher() noexcept
Destructs a FileSystemWatcher.
 
const std::filesystem::path & getPath() const noexcept
Gets the path of the folder being watched.
 
bool isExtensionWatched(const std::filesystem::path &extension) const noexcept
Gets whether or not a file extension is being watched.
 
FileSystemWatcher(const std::filesystem::path &path, bool includeSubdirectories, WatcherFlags watcherFlags=WatcherFlags::FileName|WatcherFlags::DirectoryName|WatcherFlags::Attributes|WatcherFlags::Size|WatcherFlags::LastWrite|WatcherFlags::LastAccess)
Constructs a FileSystemWatcher.
 
Definition applicationuserdirectory.h:27
 
WatcherFlags
Flags to describe properties of a file system object that can change.
Definition watcherflags.h:34
 
@ DirectoryName
The name of a directory in the file system object has changed.
Definition watcherflags.h:36
 
@ LastWrite
The last write time of an item in the file system object has changed.
Definition watcherflags.h:39
 
@ FileName
The name of a file in the file system object has changed.
Definition watcherflags.h:35
 
@ Attributes
The attributes of an item in the file system object have changed.
Definition watcherflags.h:37
 
@ LastAccess
The last access time of an item in the file system object has changed.
Definition watcherflags.h:40
 
@ Size
The size of an item in the file system object has changed.
Definition watcherflags.h:38