1 /*=============================================================================
2 Copyright (c) 2011-2013, 2017 Daniel James
4 Use, modification and distribution is subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
11 template <typename Iterator>
12 bool read(Iterator& it, Iterator end, char const* text)
14 for (Iterator it2 = it;; ++it2, ++text) {
20 if (it2 == end || *it2 != *text) return false;
24 template <typename Iterator>
25 bool read_past(Iterator& it, Iterator end, char const* text)
28 if (read(it, end, text)) {
36 inline bool find_char(char const* text, char c)
39 if (c == *text) return true;
43 template <typename Iterator>
44 void read_some_of(Iterator& it, Iterator end, char const* text)
46 while (it != end && find_char(text, *it))
50 template <typename Iterator>
51 void read_to_one_of(Iterator& it, Iterator end, char const* text)
53 while (it != end && !find_char(text, *it))
57 template <typename Iterator>
58 void read_to(Iterator& it, Iterator end, char c)
60 while (it != end && *it != c)