| 161 | |
| 162 | template <typename octet_iterator> |
| 163 | uint32_t prior(octet_iterator& it, octet_iterator start) |
| 164 | { |
| 165 | // can't do much if it == start |
| 166 | if (it == start) |
| 167 | throw not_enough_room(); |
| 168 | |
| 169 | octet_iterator end = it; |
| 170 | // Go back until we hit either a lead octet or start |
| 171 | while (utf8::internal::is_trail(*(--it))) |
| 172 | if (it == start) |
| 173 | throw invalid_utf8(*it); // error - no lead byte in the sequence |
| 174 | return utf8::peek_next(it, end); |
| 175 | } |
| 176 | |
| 177 | /// Deprecated in versions that include "prior" |
| 178 | template <typename octet_iterator> |
no test coverage detected