MCPcopy Create free account
hub / github.com/USCiLab/cereal / parse_node

Method parse_node

include/cereal/external/rapidxml/rapidxml.hpp:2096–2178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2094 // Determine node type, and parse it
2095 template<int Flags>
2096 xml_node<Ch> *parse_node(Ch *&text)
2097 {
2098 // Parse proper node type
2099 switch (text[0])
2100 {
2101
2102 // <...
2103 default:
2104 // Parse and append element node
2105 return parse_element<Flags>(text);
2106
2107 // <?...
2108 case Ch('?'):
2109 ++text; // Skip ?
2110 if ((text[0] == Ch('x') || text[0] == Ch('X')) &&
2111 (text[1] == Ch('m') || text[1] == Ch('M')) &&
2112 (text[2] == Ch('l') || text[2] == Ch('L')) &&
2113 whitespace_pred::test(text[3]))
2114 {
2115 // '<?xml ' - xml declaration
2116 text += 4; // Skip 'xml '
2117 return parse_xml_declaration<Flags>(text);
2118 }
2119 else
2120 {
2121 // Parse PI
2122 return parse_pi<Flags>(text);
2123 }
2124
2125 // <!...
2126 case Ch('!'):
2127
2128 // Parse proper subset of <! node
2129 switch (text[1])
2130 {
2131
2132 // <!-
2133 case Ch('-'):
2134 if (text[2] == Ch('-'))
2135 {
2136 // '<!--' - xml comment
2137 text += 3; // Skip '!--'
2138 return parse_comment<Flags>(text);
2139 }
2140 break;
2141
2142 // <![
2143 case Ch('['):
2144 if (text[2] == Ch('C') && text[3] == Ch('D') && text[4] == Ch('A') &&
2145 text[5] == Ch('T') && text[6] == Ch('A') && text[7] == Ch('['))
2146 {
2147 // '<![CDATA[' - cdata
2148 text += 8; // Skip '![CDATA['
2149 return parse_cdata<Flags>(text);
2150 }
2151 break;
2152
2153 // <!D

Callers

nothing calls this directly

Calls 1

testClass · 0.50

Tested by

no test coverage detected