/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: Watcher.Linux.hpp Date: 2022-4-10 Author: Reece ***/ #pragma once namespace Aurora::IO::FS { struct LinuxWatcherHandle; struct UnixCachedPath { AuString strNormalizedPath; AuString strTheCakeIsALie; AuSPtr userData; int watcherWd {-1}; bool bIsDir {}; }; struct LinuxWatcher : IWatcher { ~LinuxWatcher(); virtual bool AddWatch(const WatchRequest &file) override; virtual bool RemoveByName(const AuString &path) override; virtual bool RemoveByPrivateContext(const AuSPtr &file) override; virtual AuSPtr AsLoopSource() override; virtual AuList QueryUpdates() override; bool Init(); void Deinit(); private: AuSPtr loopSource_; AuThreadPrimitives::SpinLock spinlock_; AuList paths_; int inotifyHandle_ {-1}; }; }