/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: Watcher.hpp Date: 2022-4-1 Author: Reece ***/ #pragma once namespace Aurora::IO::FS { struct UserWatchData { virtual ~UserWatchData() {}; }; struct WatchedFile { AuSPtr userData; AuString path; }; AUE_DEFINE(EWatchEvent, ( eSelfModify, eSelfDelete, eFileModify, eFileDelete, eFileCreate )); struct WatchRequest { WatchedFile watch; // events are mere optimization hint. additional events may be provided, if available. AuList events; }; struct WatchEvent { EWatchEvent event; WatchedFile watch; AuString file; }; struct IWatcher { virtual bool AddWatch(const WatchRequest &file) = 0; virtual bool RemoveByName(const AuString &path) = 0; virtual bool RemoveByPrivateContext(const AuSPtr &file) = 0; virtual AuSPtr AsLoopSource() = 0; virtual AuList QueryUpdates() = 0; }; AUKN_SHARED_API(NewWatcher, IWatcher); }