| 6206 | // theoretically possible for some containers, but it is extremely versatile. |
| 6207 | template<typename IteratorType> |
| 6208 | class iterator_input_adapter |
| 6209 | { |
| 6210 | public: |
| 6211 | using char_type = typename std::iterator_traits<IteratorType>::value_type; |
| 6212 | |
| 6213 | iterator_input_adapter(IteratorType first, IteratorType last) |
| 6214 | : current(std::move(first)), end(std::move(last)) |
| 6215 | {} |
| 6216 | |
| 6217 | typename std::char_traits<char_type>::int_type get_character() |
| 6218 | { |
| 6219 | if (JSON_HEDLEY_LIKELY(current != end)) |
| 6220 | { |
| 6221 | auto result = std::char_traits<char_type>::to_int_type(*current); |
| 6222 | std::advance(current, 1); |
| 6223 | return result; |
| 6224 | } |
| 6225 | |
| 6226 | return std::char_traits<char_type>::eof(); |
| 6227 | } |
| 6228 | |
| 6229 | private: |
| 6230 | IteratorType current; |
| 6231 | IteratorType end; |
| 6232 | |
| 6233 | template<typename BaseInputAdapter, size_t T> |
| 6234 | friend struct wide_string_input_helper; |
| 6235 | |
| 6236 | bool empty() const |
| 6237 | { |
| 6238 | return current == end; |
| 6239 | } |
| 6240 | }; |
| 6241 | |
| 6242 | |
| 6243 | template<typename BaseInputAdapter, size_t T> |
nothing calls this directly
no outgoing calls
no test coverage detected