| 2628 | } |
| 2629 | |
| 2630 | uint32_t parse_hex(std::string::iterator& it, |
| 2631 | const std::string::iterator& end, uint32_t place) |
| 2632 | { |
| 2633 | uint32_t value = 0; |
| 2634 | while (place > 0) |
| 2635 | { |
| 2636 | if (it == end) |
| 2637 | throw_parse_exception("Unexpected end of unicode sequence"); |
| 2638 | |
| 2639 | if (!is_hex(*it)) |
| 2640 | throw_parse_exception("Invalid unicode escape sequence"); |
| 2641 | |
| 2642 | value += place * hex_to_digit(*it++); |
| 2643 | place /= 16; |
| 2644 | } |
| 2645 | return value; |
| 2646 | } |
| 2647 | |
| 2648 | uint32_t hex_to_digit(char c) |
| 2649 | { |
no test coverage detected