Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MappedFile.h
Go to the documentation of this file.
1/*
2 * MappedFile.h
3 *
4 * Created on: Jan 21, 2014
5 * Author: Manuel Sascha Weiand
6 */
7
8#ifndef STORM_PARSER_MAPPEDFILE_H_
9#define STORM_PARSER_MAPPEDFILE_H_
10
11#include <sys/stat.h>
12#include <cstddef>
13
15
16namespace storm {
17namespace parser {
18
19#if !defined LINUX && !defined MACOSX && !defined WINDOWS
20#error Platform not supported
21#endif
22
34 public:
42 MappedFile(const char* filename);
43
49
55 char const* getData() const;
56
62 char const* getDataEnd() const;
63
67 std::size_t getDataSize() const;
68
69 private:
71 char* data;
72
74 char* dataEnd;
75
76#if defined LINUX || defined MACOSX
77
79 int file;
80#elif defined WINDOWS
82 HANDLE file;
83
85 HANDLE mapping;
86#endif
87
88#if defined LINUX
89
91 struct stat64 st;
92#elif defined MACOSX
93
95 struct stat st;
96#elif defined WINDOWS
97
99 struct __stat64 st;
100#endif
101};
102
103} // namespace parser
104} // namespace storm
105
106#endif /* STORM_PARSER_MAPPEDFILE_H_ */
Opens a file and maps it to memory providing a char* containing the file content.
Definition MappedFile.h:33
char const * getData() const
Returns a pointer to the beginning of the mapped file data.
~MappedFile()
Destructs a MappedFile.
char const * getDataEnd() const
Returns a pointer to the end of the mapped file data.
std::size_t getDataSize() const
Returns the size of the mapped file data.
LabParser.cpp.
Definition cli.cpp:18