AuroraRuntime/Source/IO/FS/FileStream.NT.hpp

38 lines
975 B
C++
Raw Normal View History

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
{
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;
bool Read(const Memory::MemoryViewStreamWrite &parameters) override;
bool Write(const Memory::MemoryViewStreamRead & parameters) override;
2021-06-27 21:25:29 +00:00
void Close() override;
void Flush() override;
void WriteEoS() override;
2022-04-02 23:28:18 +00:00
void MakeTemporary() override;
2021-06-27 21:25:29 +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