MCPcopy Create free account
hub / github.com/boostorg/parser / no_case_iter

Class no_case_iter

include/boost/parser/parser.hpp:1692–1749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1690
1691 template<typename I, typename S>
1692 struct no_case_iter : stl_interfaces::proxy_iterator_interface<
1693 no_case_iter<I, S>,
1694 std::forward_iterator_tag,
1695 char32_t>
1696 {
1697 no_case_iter() : it_(), last_(), idx_(0), last_idx_() {}
1698 no_case_iter(I it, S last) :
1699 it_(it), last_(last), idx_(0), last_idx_(0)
1700 {
1701 fold();
1702 }
1703
1704 char32_t operator*() const { return folded_[idx_]; }
1705 no_case_iter & operator++()
1706 {
1707 ++idx_;
1708 if (last_idx_ <= idx_) {
1709 ++it_;
1710 fold();
1711 }
1712 return *this;
1713 }
1714 I base() const { return it_; }
1715 friend bool operator==(no_case_iter lhs, S rhs) noexcept
1716 {
1717 return lhs.it_ == rhs;
1718 }
1719 friend bool operator==(no_case_iter lhs, no_case_iter rhs) noexcept
1720 {
1721 return lhs.it_ == rhs.it_ && lhs.idx_ == rhs.idx_;
1722 }
1723
1724 using base_type = stl_interfaces::proxy_iterator_interface<
1725 no_case_iter<I, S>,
1726 std::forward_iterator_tag,
1727 char32_t>;
1728 using base_type::operator++;
1729
1730 private:
1731 void fold()
1732 {
1733 idx_ = 0;
1734 if (it_ == last_) {
1735 folded_[0] = 0;
1736 last_idx_ = 1;
1737 return;
1738 }
1739 auto const folded_last =
1740 detail::case_fold(*it_, folded_.begin());
1741 last_idx_ = int(folded_last - folded_.begin());
1742 }
1743
1744 case_fold_array_t folded_;
1745 I it_;
1746 [[no_unique_address]] S last_;
1747 int idx_;
1748 int last_idx_;
1749 };

Callers 3

mainFunction · 0.85
containsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected