/*** Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: AFIO.hpp Date: 2021-8-21 Author: Reece ***/ #pragma once namespace Aurora::IO::FS { class IAsyncTransaction; class IAsyncFileStream { public: virtual AuSPtr NewTransaction() = 0; }; class IAsyncFinishedSubscriber { public: virtual void OnAsyncFileOpFinished(AuUInt64 offset, AuUInt32 length) = 0; }; class IAsyncTransaction { public: virtual bool StartRead(AuUInt64 offset, void *, AuUInt32 length) = 0; virtual bool StartWrite(AuUInt64 offset, const void *, AuUInt32 length) = 0; virtual bool Complete() = 0; virtual AuUInt32 GetLastPacketLength() = 0; virtual void SetCallback(const AuSPtr &sub) = 0; virtual void Wait(AuUInt32 timeout) = 0; }; AUKN_SHARED_API(OpenAsync, IAsyncFileStream, const AuString &path, bool readOnly = true, bool directIO = false); AUKN_SYM bool WaitMultiple(const AuList &files, AuUInt32 timeout); }