EHS
File_UNX.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 int hdl;
17 void* map;
18 UInt_64 mapSize;
19
20 public:
21 ~File() override;
22
23 File();
24
25 File(const Str_8& filePath, const Mode mode, const Disposition disposition);
26
27 File(File&& file) noexcept;
28
29 File(const File& file);
30
31 File& operator=(File&& file) noexcept;
32
33 File& operator=(const File& file);
34
35 operator const Byte*() const override;
36
37 operator Byte*() override;
38
39 void Release() override;
40
41 bool IsMapped() const override;
42
43 UInt_64 MapSize() const override;
44
45 void Map(const UInt_64 offset, const UInt_64 size) override;
46
47 void Unmap() override;
48
49 void FlushMap() override;
50
51 UInt_64 Write(const Byte* const data, const UInt_64 size) override;
52
53 UInt_64 Read(Byte* const buffer, const UInt_64 size) override;
54
55 void Seek(UInt_64 index) override;
56
57 void SeekBeginning() override;
58
59 void SeekEnd() override;
60
61 void Truncate(const UInt_64 size) override;
62
63 UInt_64 Size() const override;
64
65 bool IsValid() const override;
66
67 static void Rename_32(const Str_32& filePath, const Str_32& newName);
68
69 static void Rename_16(const Str_16& filePath, const Str_16& newName);
70
71 static void Rename_8(const Str_8& filePath, const Str_8& newName);
72 };
73}
A cross-platform wrapper class that handles native file input/output.
Definition: BaseFile.h:29
Definition: File_UNX.h:14
Definition: Anchor.h:6
Mode
Definition: BaseFile.h:12
unsigned char Byte
Definition: Types.h:39
Disposition
Definition: BaseFile.h:19