로딩중...
검색중...
일치하는것 없음
cpIter.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
4#include "indep/common.hpp"
5#include "indep/macro.hpp"
6
7namespace by {
54 class _nout cpIter {
55 BY(ME(cpIter))
56
57 public:
63 cpIter(const nchar* begin, const nchar* from);
64
71 explicit cpIter(const std::string& from, nbool isReversed = false);
72
73 cpIter(std::string&& from, nbool isReversed = false) = delete;
74
75 public:
76 me operator+(ncnt step);
77 me& operator++();
78 me operator++(int);
79 me& operator+=(ncnt step);
80 std::string operator*() const;
81 explicit operator nbool() const;
82 nbool operator==(const me& rhs) const;
83
84 public:
85 nbool isEnd() const;
86 void rel();
87
94
101
108
109 std::string get() const;
110 ncnt remainLen() const;
111
112 private:
113 ncnt _step(const std::function<const nchar*()>& closure, ncnt step);
114 const nchar* _nextCodepoint(const nchar* from) const;
115 const nchar* _prevCodepoint(const nchar* e) const;
116 ncnt _skipBytes(nchar ch) const;
117
118 private:
119 const nchar* _begin;
120 const nchar* _end;
121 nbool _isReversed;
122 };
123} // namespace by
func closure with captured object scope
Definition closure.hpp:20
Codepoint-based string iterator
Definition cpIter.hpp:54
ncnt next(ncnt step)
Advances iterator in its default direction
cpIter(const nchar *begin, const nchar *from)
Constructs iterator from pointer range
ncnt stepBackward(ncnt step)
Unconditionally advances iterator backward
ncnt stepForward(ncnt step)
Unconditionally advances iterator forward
cpIter(const std::string &from, nbool isReversed=false)
Constructs iterator from string reference
Weak reference smart pointer with type-safe access
Definition tweak.hpp:16
to Top