diff options
Diffstat (limited to 'MoonParser/pegtl/argv_input.hpp')
-rw-r--r-- | MoonParser/pegtl/argv_input.hpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/MoonParser/pegtl/argv_input.hpp b/MoonParser/pegtl/argv_input.hpp deleted file mode 100644 index 3846975..0000000 --- a/MoonParser/pegtl/argv_input.hpp +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | // Copyright (c) 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_ARGV_INPUT_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_ARGV_INPUT_HPP | ||
6 | |||
7 | #include <cstddef> | ||
8 | #include <sstream> | ||
9 | #include <string> | ||
10 | #include <utility> | ||
11 | |||
12 | #include "config.hpp" | ||
13 | #include "eol.hpp" | ||
14 | #include "memory_input.hpp" | ||
15 | #include "tracking_mode.hpp" | ||
16 | |||
17 | namespace tao | ||
18 | { | ||
19 | namespace TAOCPP_PEGTL_NAMESPACE | ||
20 | { | ||
21 | namespace internal | ||
22 | { | ||
23 | inline std::string make_argv_source( const std::size_t argn ) | ||
24 | { | ||
25 | std::ostringstream os; | ||
26 | os << "argv[" << argn << ']'; | ||
27 | return os.str(); | ||
28 | } | ||
29 | |||
30 | } // namespace internal | ||
31 | |||
32 | template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf > | ||
33 | struct argv_input | ||
34 | : public memory_input< P, Eol > | ||
35 | { | ||
36 | template< typename T > | ||
37 | argv_input( char** argv, const std::size_t argn, T&& in_source ) | ||
38 | : memory_input< P, Eol >( static_cast< const char* >( argv[ argn ] ), std::forward< T >( in_source ) ) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | argv_input( char** argv, const std::size_t argn ) | ||
43 | : argv_input( argv, argn, internal::make_argv_source( argn ) ) | ||
44 | { | ||
45 | } | ||
46 | }; | ||
47 | |||
48 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
49 | |||
50 | } // namespace tao | ||
51 | |||
52 | #endif | ||