| 715 | }; |
| 716 | |
| 717 | template <typename Iter> inline int _parse_quadhex(input<Iter> &in) { |
| 718 | int uni_ch = 0, hex; |
| 719 | for (int i = 0; i < 4; i++) { |
| 720 | if ((hex = in.getc()) == -1) { |
| 721 | return -1; |
| 722 | } |
| 723 | if ('0' <= hex && hex <= '9') { |
| 724 | hex -= '0'; |
| 725 | } else if ('A' <= hex && hex <= 'F') { |
| 726 | hex -= 'A' - 0xa; |
| 727 | } else if ('a' <= hex && hex <= 'f') { |
| 728 | hex -= 'a' - 0xa; |
| 729 | } else { |
| 730 | in.ungetc(); |
| 731 | return -1; |
| 732 | } |
| 733 | uni_ch = uni_ch * 16 + hex; |
| 734 | } |
| 735 | return uni_ch; |
| 736 | } |
| 737 | |
| 738 | template <typename String, typename Iter> inline bool _parse_codepoint(String &out, input<Iter> &in) { |
| 739 | int uni_ch; |
no test coverage detected