EHS
Loading...
Searching...
No Matches
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}
Mode mode
Definition BaseFile.h:35
Disposition disposition
Definition BaseFile.h:36
BaseFile()
Default members initialization.
Definition BaseFile.cpp:5
void SeekBeginning() override
Definition File_UNX.cpp:252
static void Rename_32(const Str_32 &filePath, const Str_32 &newName)
Definition File_UNX.cpp:294
static void Rename_16(const Str_16 &filePath, const Str_16 &newName)
Definition File_UNX.cpp:299
void Seek(UInt_64 index) override
Definition File_UNX.cpp:243
void Unmap() override
Definition File_UNX.cpp:196
UInt_64 MapSize() const override
Definition File_UNX.cpp:162
bool IsMapped() const override
Definition File_UNX.cpp:157
static void Rename_8(const Str_8 &filePath, const Str_8 &newName)
Definition File_UNX.cpp:304
File()
Definition File_UNX.cpp:22
void Release() override
Definition File_UNX.cpp:145
UInt_64 Read(Byte *const buffer, const UInt_64 size) override
Definition File_UNX.cpp:230
File & operator=(File &&file) noexcept
Definition File_UNX.cpp:105
void SeekEnd() override
Definition File_UNX.cpp:261
void FlushMap() override
Definition File_UNX.cpp:208
void Map(const UInt_64 offset, const UInt_64 size) override
Definition File_UNX.cpp:167
UInt_64 Write(const Byte *const data, const UInt_64 size) override
Definition File_UNX.cpp:217
UInt_64 Size() const override
Definition File_UNX.cpp:279
void Truncate(const UInt_64 size) override
Definition File_UNX.cpp:270
bool IsValid() const override
Definition File_UNX.cpp:289
Definition Anchor.h:6
Str< Char_16, UInt_64 > Str_16
Definition Str.h:1952
Mode
Definition BaseFile.h:12
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953
unsigned char Byte
Definition Types.h:39
Disposition
Definition BaseFile.h:19
Str< Char_32, UInt_64 > Str_32
Definition Str.h:1951