MCPcopy Create free account
hub / github.com/cinder/Cinder / iterator

Class iterator

include/utf8cpp/unchecked.h:179–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177 // The iterator class
178 template <typename octet_iterator>
179 class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
180 octet_iterator it;
181 public:
182 iterator () {}
183 explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
184 // the default "big three" are OK
185 octet_iterator base () const { return it; }
186 uint32_t operator * () const
187 {
188 octet_iterator temp = it;
189 return utf8::unchecked::next(temp);
190 }
191 bool operator == (const iterator& rhs) const
192 {
193 return (it == rhs.it);
194 }
195 bool operator != (const iterator& rhs) const
196 {
197 return !(operator == (rhs));
198 }
199 iterator& operator ++ ()
200 {
201 ::std::advance(it, utf8::internal::sequence_length(it));
202 return *this;
203 }
204 iterator operator ++ (int)
205 {
206 iterator temp = *this;
207 ::std::advance(it, utf8::internal::sequence_length(it));
208 return temp;
209 }
210 iterator& operator -- ()
211 {
212 utf8::unchecked::prior(it);
213 return *this;
214 }
215 iterator operator -- (int)
216 {
217 iterator temp = *this;
218 utf8::unchecked::prior(it);
219 return temp;
220 }
221 }; // class iterator
222
223 } // namespace utf8::unchecked
224} // namespace utf8

Callers

nothing calls this directly

Calls 3

sequence_lengthFunction · 0.85
advanceFunction · 0.70
priorFunction · 0.70

Tested by

no test coverage detected