2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Str.h"
|
|
|
|
#include "UTF.h"
|
|
|
|
#include "Vector.h"
|
|
|
|
#include "Array.h"
|
|
|
|
#include "Serializer.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
#include "BaseFile.h"
|
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
class File : public BaseFile
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
HANDLE hdl;
|
|
|
|
HANDLE map;
|
|
|
|
Byte* view;
|
|
|
|
UInt_64 viewSize;
|
|
|
|
|
|
|
|
public:
|
|
|
|
~File() override;
|
|
|
|
|
|
|
|
File();
|
|
|
|
|
|
|
|
File(const Str_8& filePath, const Mode mode, const Disposition disposition);
|
|
|
|
|
|
|
|
File(File&& file) noexcept;
|
|
|
|
|
|
|
|
File(const File& file);
|
|
|
|
|
|
|
|
File& operator=(File&& file) noexcept;
|
|
|
|
|
|
|
|
File& operator=(const File& file);
|
|
|
|
|
|
|
|
operator const Byte*() const override;
|
|
|
|
|
|
|
|
operator Byte*() override;
|
|
|
|
|
|
|
|
void Release() override;
|
|
|
|
|
|
|
|
bool IsMapped() const override;
|
|
|
|
|
|
|
|
UInt_64 MapSize() const override;
|
|
|
|
|
|
|
|
void Map(const UInt_64 offset, const UInt_64 size) override;
|
|
|
|
|
|
|
|
void Unmap() override;
|
|
|
|
|
|
|
|
void FlushMap() override;
|
|
|
|
|
|
|
|
UInt_64 Write(const Byte* const data, const UInt_64 size) override;
|
|
|
|
|
|
|
|
UInt_64 Read(Byte* const buffer, const UInt_64 size) override;
|
|
|
|
|
|
|
|
void Seek(UInt_64 index) override;
|
|
|
|
|
|
|
|
void SeekBeginning() override;
|
|
|
|
|
|
|
|
void SeekEnd() override;
|
|
|
|
|
|
|
|
void Truncate(const UInt_64 size) override;
|
|
|
|
|
|
|
|
UInt_64 Size() const override;
|
|
|
|
|
|
|
|
bool IsValid() const override;
|
|
|
|
|
|
|
|
static void Rename_32(const Str_32& filePath, const Str_32& newName);
|
|
|
|
|
|
|
|
static void Rename_16(const Str_16& filePath, const Str_16& newName);
|
|
|
|
|
|
|
|
static void Rename_8(const Str_8& filePath, const Str_8& newName);
|
|
|
|
};
|
|
|
|
}
|