| 1984 | } |
| 1985 | |
| 1986 | PUGI__FN char_t* strconv_cdata(char_t* s, char_t endch) |
| 1987 | { |
| 1988 | gap g; |
| 1989 | |
| 1990 | while (true) |
| 1991 | { |
| 1992 | while (!PUGI__IS_CHARTYPE(*s, ct_parse_cdata)) |
| 1993 | ++s; |
| 1994 | |
| 1995 | if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair |
| 1996 | { |
| 1997 | *s++ = '\n'; // replace first one with 0x0a |
| 1998 | |
| 1999 | if (*s == '\n') |
| 2000 | g.push(s, 1); |
| 2001 | } |
| 2002 | else if (s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')) // CDATA ends here |
| 2003 | { |
| 2004 | *g.flush(s) = 0; |
| 2005 | |
| 2006 | return s + 1; |
| 2007 | } |
| 2008 | else if (*s == 0) |
| 2009 | { |
| 2010 | return 0; |
| 2011 | } |
| 2012 | else |
| 2013 | ++s; |
| 2014 | } |
| 2015 | } |
| 2016 | |
| 2017 | typedef char_t* (*strconv_pcdata_t)(char_t*); |
| 2018 |
no test coverage detected