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

36 lines
874 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: FileStream.Win32.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
#if !defined(_AURUNTIME_GENERICFILESTREAM)
namespace Aurora::IO::FS
{
class PosixFileStream : public IFileStream
{
public:
~PosixFileStream();
void Init(int handle, const AuString &path);
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;
void Close() override;
void Flush() override;
void WriteEoS() override;
private:
int handle_ = -1;
AuString path_;
};
}
#endif