15template<concepts::Encoding Enc>
17 :
public IteratorBase<PathIterator<Enc>, BidirectionalIteratorTag, string::StringViewImpl<Enc>, ssize_t> {
22 constexpr explicit PathIterator(View bounds, View current) : m_bounds(bounds), m_current(current) {}
27 constexpr auto operator*()
const {
return m_current; }
33 DI_ASSERT(m_current.begin() != m_bounds.end());
37 if (new_start == m_bounds.end()) {
38 m_current = { m_bounds.end(), m_bounds.end() };
43 auto new_end =
find(new_start, m_bounds.end(), CodePoint(
'/'));
44 m_current = { new_start, new_end };
52 DI_ASSERT(m_current.begin() != m_bounds.begin());
54 while (new_end != m_bounds.begin() && *new_end == CodePoint(
'/')) {
59 if (new_end == m_bounds.begin()) {
65 auto new_start = new_end;
66 while (new_start != m_bounds.begin() && *new_start != CodePoint(
'/')) {
71 if (*new_start == CodePoint(
'/')) {
82 template<
typename, concepts::Encoding>
85 constexpr friend auto operator==(PathIterator
const& a, PathIterator
const& b) ->
bool {
86 return a.m_current == b.m_current;
88 constexpr friend auto operator<=>(PathIterator
const& a, PathIterator
const& b) {
89 return a.m_current.
data() <=> b.m_current.
data();
#define DI_ASSERT(...)
Definition assert_bool.h:7
constexpr auto current_data()
Definition path_iterator.h:29
friend class ConstantPathInterface
Definition path_iterator.h:83
constexpr friend auto operator<=>(PathIterator const &a, PathIterator const &b)
Definition path_iterator.h:88
constexpr friend auto operator==(PathIterator const &a, PathIterator const &b) -> bool
Definition path_iterator.h:85
constexpr auto operator*() const
Definition path_iterator.h:27
constexpr void back_one()
Definition path_iterator.h:50
constexpr void advance_one()
Definition path_iterator.h:31
constexpr auto data() const
Definition constant_string_interface.h:67
Definition string_view_impl_forward_declaration.h:7
constexpr auto single
Definition single.h:23
constexpr auto prev
Definition prev.h:28
constexpr auto next
Definition next.h:35
constexpr auto find
Definition find.h:35
constexpr auto equal
Definition equal.h:46
constexpr auto find_if_not
Definition find_if_not.h:31
constexpr auto equal
Definition equal.h:23