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();
|
|
|
|
|
2021-09-06 10:58:08 +00:00
|
|
|
void Init(HANDLE handle, const AuString &path);
|
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;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2022-08-10 09:50:49 +00:00
|
|
|
HANDLE GetHandle();
|
2021-06-27 21:25:29 +00:00
|
|
|
private:
|
|
|
|
|
2022-04-02 23:28:18 +00:00
|
|
|
bool bShouldDelete {};
|
2021-06-27 21:25:29 +00:00
|
|
|
HANDLE handle_ = INVALID_HANDLE_VALUE;
|
2021-09-06 10:58:08 +00:00
|
|
|
AuString path_;
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|