EHS
Loading...
Searching...
No Matches
File_W32.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Str.h"
5#include "ehs/UTF.h"
6#include "ehs/Vector.h"
7#include "ehs/Array.h"
8#include "ehs/Serializer.h"
9#include "BaseFile.h"
10
11namespace ehs
12{
13 class EHS_LIB_IO File : public BaseFile
14 {
15 private:
16 HANDLE hdl;
17 HANDLE map;
18 Byte* view;
19 UInt_64 viewSize;
20
21 public:
22 ~File() override;
23
25
26 File(const Str_8& filePath, const Mode mode, const Disposition disposition);
27
28 File(File&& file) noexcept;
29
30 File(const File& file);
31
32 File& operator=(File&& file) noexcept;
33
34 File& operator=(const File& file);
35
36 operator const Byte*() const override;
37
38 operator Byte*() override;
39
40 void Release() override;
41
42 bool IsMapped() const override;
43
44 UInt_64 MapSize() const override;
45
46 void Map(const UInt_64 offset, const UInt_64 size) override;
47
48 void Unmap() override;
49
50 void FlushMap() override;
51
52 UInt_64 Write(const Byte* const data, const UInt_64 size) override;
53
54 UInt_64 Read(Byte* const buffer, const UInt_64 size) override;
55
56 void Seek(UInt_64 index) override;
57
58 void SeekBeginning() override;
59
60 void SeekEnd() override;
61
62 void Truncate(const UInt_64 size) override;
63
64 UInt_64 Size() const override;
65
66 bool IsValid() const override;
67
68 static void Rename_32(const Str_32& filePath, const Str_32& newName);
69
70 static void Rename_16(const Str_16& filePath, const Str_16& newName);
71
72 static void Rename_8(const Str_8& filePath, const Str_8& newName);
73 };
74}
A cross-platform wrapper class that handles native file input/output.
Definition BaseFile.h:29
Mode mode
Definition BaseFile.h:35
Disposition disposition
Definition BaseFile.h:36
Definition File_UNX.h:14
static void Rename_8(const Str_8 &filePath, const Str_8 &newName)
void SeekBeginning() override
static void Rename_32(const Str_32 &filePath, const Str_32 &newName)
void Seek(UInt_64 index) override
void Unmap() override
UInt_64 MapSize() const override
bool IsMapped() const override
File(const Str_8 &filePath, const Mode mode, const Disposition disposition)
void Release() override
UInt_64 Read(Byte *const buffer, const UInt_64 size) override
static void Rename_16(const Str_16 &filePath, const Str_16 &newName)
File & operator=(File &&file) noexcept
void SeekEnd() override
File & operator=(const File &file)
void FlushMap() override
void Map(const UInt_64 offset, const UInt_64 size) override
UInt_64 Write(const Byte *const data, const UInt_64 size) override
UInt_64 Size() const override
~File() override
void Truncate(const UInt_64 size) override
bool IsValid() const override
File(const File &file)
File(File &&file) noexcept
Definition Anchor.h:6
Str< Char_16, UInt_64 > Str_16
Definition Str.h:1901
Mode
Definition BaseFile.h:12
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1902
unsigned char Byte
Definition Types.h:39
Disposition
Definition BaseFile.h:19
Str< Char_32, UInt_64 > Str_32
Definition Str.h:1900