MCPcopy Create free account
hub / github.com/MyGUI/mygui / strconv_cdata

Function strconv_cdata

UnitTests/TestApp/pugixml.cpp:1986–2015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1984}
1985
1986PUGI__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
2017typedef char_t* (*strconv_pcdata_t)(char_t*);
2018

Callers 1

parse_exclamationMethod · 0.70

Calls 2

pushMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected