-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMappedFile.h
More file actions
39 lines (30 loc) · 852 Bytes
/
MappedFile.h
File metadata and controls
39 lines (30 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright (C) 2016-2020 Thomas Hauck - All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
The author would be happy if changes and
improvements were reported back to him.
Author: Thomas Hauck
Email: Thomas@fam-hauck.de
*/
#ifndef MAPPEDFILE_H
#define MAPPEDFILE_H
#include <string>
#include <cstdint>
class MappedFile
{
public:
MappedFile();
~MappedFile();
bool open(const std::wstring& filePath);
const uint8_t* data() const;
uint64_t size() const;
void setOffset(const uint64_t offset);
void addOffset(const uint64_t offset);
uint64_t getOffset() const { return offset; }
private:
std::wstring filePath;
const uint8_t* mappedData;
uint64_t fileSize;
uint64_t offset;
};
#endif // MAPPEDFILE_H