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

39 lines
1.0 KiB
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();
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;
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;
2023-07-29 08:13:43 +00:00
AuSPtr<IIOHandle> GetHandle() override;
2021-06-27 21:25:29 +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