diff options
Diffstat (limited to 'MoonParser/pegtl/mmap_input.hpp')
-rw-r--r-- | MoonParser/pegtl/mmap_input.hpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/MoonParser/pegtl/mmap_input.hpp b/MoonParser/pegtl/mmap_input.hpp deleted file mode 100644 index 0a112ef..0000000 --- a/MoonParser/pegtl/mmap_input.hpp +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | // Copyright (c) 2014-2017 Dr. Colin Hirsch and Daniel Frey | ||
2 | // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ | ||
3 | |||
4 | #ifndef TAOCPP_PEGTL_INCLUDE_MMAP_INPUT_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_MMAP_INPUT_HPP | ||
6 | |||
7 | #include <string> | ||
8 | #include <utility> | ||
9 | |||
10 | #include "config.hpp" | ||
11 | #include "eol.hpp" | ||
12 | #include "memory_input.hpp" | ||
13 | #include "tracking_mode.hpp" | ||
14 | |||
15 | #include "internal/file_mapper.hpp" | ||
16 | |||
17 | namespace tao | ||
18 | { | ||
19 | namespace TAOCPP_PEGTL_NAMESPACE | ||
20 | { | ||
21 | namespace internal | ||
22 | { | ||
23 | struct mmap_holder | ||
24 | { | ||
25 | const std::string filename; | ||
26 | const file_mapper data; | ||
27 | |||
28 | template< typename T > | ||
29 | mmap_holder( T&& in_filename ) | ||
30 | : filename( std::forward< T >( in_filename ) ), | ||
31 | data( filename.c_str() ) | ||
32 | { | ||
33 | } | ||
34 | }; | ||
35 | |||
36 | } // namespace internal | ||
37 | |||
38 | template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf > | ||
39 | struct mmap_input | ||
40 | : private internal::mmap_holder, | ||
41 | public memory_input< P, Eol, const char* > | ||
42 | { | ||
43 | template< typename T > | ||
44 | explicit mmap_input( T&& in_filename ) | ||
45 | : internal::mmap_holder( std::forward< T >( in_filename ) ), | ||
46 | memory_input< P, Eol, const char* >( data.begin(), data.end(), filename.c_str() ) | ||
47 | { | ||
48 | } | ||
49 | }; | ||
50 | |||
51 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
52 | |||
53 | } // namespace tao | ||
54 | |||
55 | #endif | ||