AuroraRuntime/Source/IO/FS/FileStream.Unix.hpp
2021-09-06 11:58:08 +01:00

35 lines
789 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 PosixStream : public IFileStream
{
public:
~PosixStream();
void Init(int handle, const AuString &path);
AuUInt64 GetOffset() override;
bool SetOffset(AuUInt64 offset) override;
AuUInt64 GetLength() override;
AuUInt64 Read(void *in, AuUInt64 length) override;
AuUInt64 Write(const void *out, AuUInt64 length) override;
void Close() override;
void Flush() override;
private:
int handle_ = -1;
AuString path_;
};
}
#endif