[+] Possible watcher api
This commit is contained in:
parent
24ea76e30e
commit
2b4bb66e0c
36
Include/Aurora/IO/FS/Watcher.hpp
Normal file
36
Include/Aurora/IO/FS/Watcher.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
/***
|
||||
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<UserWatchData> userData;
|
||||
AuString path;
|
||||
};
|
||||
|
||||
struct IWatcher
|
||||
{
|
||||
virtual bool AddWatch(const WatchedFile &file) = 0;
|
||||
|
||||
virtual bool RemoveByName(const AuString &path) = 0;
|
||||
virtual bool RemoveByPrivateContext(const AuSPtr<UserWatchData> &file) = 0;
|
||||
|
||||
virtual AuSPtr<Loop::ILoopSource> AsLoopSource() = 0;
|
||||
|
||||
virtual AuList<WatchedFile> QueryUpdates() = 0;
|
||||
};
|
||||
|
||||
AUKN_SHARED_API(NewWatcher, IWatcher);
|
||||
}
|
Loading…
Reference in New Issue
Block a user