39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: FileStream.NT.hpp
|
|
Date: 2021-6-12
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#if !defined(_AURUNTIME_GENERICFILESTREAM)
|
|
|
|
namespace Aurora::IO::FS
|
|
{
|
|
struct WinFileStream : IFileStream
|
|
{
|
|
~WinFileStream();
|
|
|
|
void Init(AuSPtr<IIOHandle> pHandle);
|
|
|
|
AuUInt64 GetOffset() override;
|
|
bool SetOffset(AuUInt64 offset) override;
|
|
AuUInt64 GetLength() override;
|
|
bool Read(const Memory::MemoryViewStreamWrite ¶meters) override;
|
|
bool Write(const Memory::MemoryViewStreamRead & parameters) override;
|
|
void Close() override;
|
|
void Flush() override;
|
|
void WriteEoS() override;
|
|
void MakeTemporary() override;
|
|
AuSPtr<IIOHandle> GetHandle() override;
|
|
|
|
HANDLE GetWin32Handle(bool bReadOnly = false);
|
|
|
|
private:
|
|
AuSPtr<IIOHandle> pHandle_;
|
|
bool bShouldDelete {};
|
|
HANDLE hEventHandle_ { INVALID_HANDLE_VALUE };
|
|
};
|
|
}
|
|
#endif |