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

Function strconv_comment

Tools/EditorFramework/pugixml.cpp:1955–1984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1953#define ENDSWITH(c, e) ((c) == (e) || ((c) == 0 && endch == (e)))
1954
1955PUGI__FN char_t* strconv_comment(char_t* s, char_t endch)
1956{
1957 gap g;
1958
1959 while (true)
1960 {
1961 while (!PUGI__IS_CHARTYPE(*s, ct_parse_comment))
1962 ++s;
1963
1964 if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair
1965 {
1966 *s++ = '\n'; // replace first one with 0x0a
1967
1968 if (*s == '\n')
1969 g.push(s, 1);
1970 }
1971 else if (s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')) // comment ends here
1972 {
1973 *g.flush(s) = 0;
1974
1975 return s + (s[2] == '>' ? 3 : 2);
1976 }
1977 else if (*s == 0)
1978 {
1979 return 0;
1980 }
1981 else
1982 ++s;
1983 }
1984}
1985
1986PUGI__FN char_t* strconv_cdata(char_t* s, char_t endch)
1987{

Callers 1

parse_exclamationMethod · 0.70

Calls 2

pushMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected