123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- #ifndef BOOST_SPIRIT_RANGE_RUN_HPP
- #define BOOST_SPIRIT_RANGE_RUN_HPP
- #include <vector>
- #include <boost/spirit/home/classic/namespace.hpp>
- namespace boost { namespace spirit {
- BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
- namespace utility { namespace impl {
-
-
-
-
-
-
-
-
-
-
-
- template <typename CharT>
- struct range {
- range(CharT first, CharT last);
- bool is_valid() const;
- bool includes(CharT v) const;
- bool includes(range const& r) const;
- bool overlaps(range const& r) const;
- void merge(range const& r);
- CharT first;
- CharT last;
- };
-
- template <typename CharT>
- struct range_char_compare {
- bool operator()(range<CharT> const& x, const CharT y) const
- { return x.first < y; }
-
- bool operator()(const CharT x, range<CharT> const& y) const
- { return x < y.first; }
-
-
-
-
-
- bool operator()(range<CharT> const& x, range<CharT> const& y) const
- { return x.first < y.first; }
- };
-
- template <typename CharT>
- struct range_compare {
- bool operator()(range<CharT> const& x, range<CharT> const& y) const
- { return x.first < y.first; }
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template <typename CharT>
- class range_run {
- public:
- typedef range<CharT> range_t;
- typedef std::vector<range_t> run_t;
- typedef typename run_t::iterator iterator;
- typedef typename run_t::const_iterator const_iterator;
- void swap(range_run& rr);
- bool test(CharT v) const;
- void set(range_t const& r);
- void clear(range_t const& r);
- void clear();
- const_iterator begin() const;
- const_iterator end() const;
- private:
- void merge(iterator iter, range_t const& r);
- run_t run;
- };
- }}
- BOOST_SPIRIT_CLASSIC_NAMESPACE_END
- }}
- #endif
- #include <boost/spirit/home/classic/utility/impl/chset/range_run.ipp>
|