| 1379 | //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. |
| 1380 | template<int Flags> |
| 1381 | void parse(Ch *text) |
| 1382 | { |
| 1383 | assert(text); |
| 1384 | |
| 1385 | // Remove current contents |
| 1386 | this->remove_all_nodes(); |
| 1387 | this->remove_all_attributes(); |
| 1388 | |
| 1389 | // Parse BOM, if any |
| 1390 | parse_bom<Flags>(text); |
| 1391 | |
| 1392 | // Parse children |
| 1393 | while (1) |
| 1394 | { |
| 1395 | // Skip whitespace before node |
| 1396 | skip<whitespace_pred, Flags>(text); |
| 1397 | if (*text == 0) |
| 1398 | break; |
| 1399 | |
| 1400 | // Parse and append new child |
| 1401 | if (*text == Ch('<')) |
| 1402 | { |
| 1403 | ++text; // Skip '<' |
| 1404 | if (xml_node<Ch> *node = parse_node<Flags>(text)) |
| 1405 | this->append_node(node); |
| 1406 | } |
| 1407 | else |
| 1408 | RAPIDXML_PARSE_ERROR("expected <", text); |
| 1409 | } |
| 1410 | |
| 1411 | } |
| 1412 | |
| 1413 | //! Clears the document by deleting all nodes and clearing the memory pool. |
| 1414 | //! All nodes owned by document pool are destroyed. |
nothing calls this directly
no test coverage detected