2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
File: FileStream.NT.hpp
|
2021-06-27 21:25:29 +00:00
|
|
|
Date: 2021-6-12
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if !defined(_AURUNTIME_GENERICFILESTREAM)
|
|
|
|
|
|
|
|
namespace Aurora::IO::FS
|
|
|
|
{
|
2022-08-10 09:50:49 +00:00
|
|
|
struct WinFileStream : IFileStream
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
~WinFileStream();
|
|
|
|
|
2023-07-29 07:02:47 +00:00
|
|
|
void Init(AuSPtr<IIOHandle> pHandle);
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
AuUInt64 GetOffset() override;
|
|
|
|
bool SetOffset(AuUInt64 offset) override;
|
|
|
|
AuUInt64 GetLength() override;
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Read(const Memory::MemoryViewStreamWrite ¶meters) override;
|
|
|
|
bool Write(const Memory::MemoryViewStreamRead & parameters) override;
|
2021-06-27 21:25:29 +00:00
|
|
|
void Close() override;
|
|
|
|
void Flush() override;
|
2022-01-17 15:21:36 +00:00
|
|
|
void WriteEoS() override;
|
2022-04-02 23:28:18 +00:00
|
|
|
void MakeTemporary() override;
|
2023-07-29 08:13:43 +00:00
|
|
|
AuSPtr<IIOHandle> GetHandle() override;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2023-08-15 13:41:49 +00:00
|
|
|
HANDLE GetWin32Handle(bool bReadOnly = false);
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2023-07-29 07:02:47 +00:00
|
|
|
private:
|
|
|
|
AuSPtr<IIOHandle> pHandle_;
|
2022-04-02 23:28:18 +00:00
|
|
|
bool bShouldDelete {};
|
2023-07-29 07:02:47 +00:00
|
|
|
HANDLE hEventHandle_ { INVALID_HANDLE_VALUE };
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|