| 2020 | struct strconv_pcdata_impl |
| 2021 | { |
| 2022 | static char_t* parse(char_t* s) |
| 2023 | { |
| 2024 | gap g; |
| 2025 | |
| 2026 | while (true) |
| 2027 | { |
| 2028 | while (!PUGI__IS_CHARTYPE(*s, ct_parse_pcdata)) |
| 2029 | ++s; |
| 2030 | |
| 2031 | if (*s == '<') // PCDATA ends here |
| 2032 | { |
| 2033 | *g.flush(s) = 0; |
| 2034 | |
| 2035 | return s + 1; |
| 2036 | } |
| 2037 | else if (opt_eol::value && *s == '\r') // Either a single 0x0d or 0x0d 0x0a pair |
| 2038 | { |
| 2039 | *s++ = '\n'; // replace first one with 0x0a |
| 2040 | |
| 2041 | if (*s == '\n') |
| 2042 | g.push(s, 1); |
| 2043 | } |
| 2044 | else if (opt_escape::value && *s == '&') |
| 2045 | { |
| 2046 | s = strconv_escape(s, g); |
| 2047 | } |
| 2048 | else if (*s == 0) |
| 2049 | { |
| 2050 | return s; |
| 2051 | } |
| 2052 | else |
| 2053 | ++s; |
| 2054 | } |
| 2055 | } |
| 2056 | }; |
| 2057 | |
| 2058 | PUGI__FN strconv_pcdata_t get_strconv_pcdata(unsigned int optmask) |
nothing calls this directly
no test coverage detected