PROFASI
Version 1.5
|
A small class to do the book keeping for XML parsing. More...
#include <prf_xml.hh>
Public Member Functions | |
XML_Mini () | |
Default constructor. | |
size_t | read_file (std::string fl) |
Read XML file as a list of Chunk s. | |
XML_Node * | build_tree () |
Build XML tree and return pointer to the root element. | |
size_t | parse_data (std::string &dat) |
Takes a string, and parses it into a list of Chunk objects. | |
void | clear () |
Clear all data. | |
Divides the task into simple logical blocks like reading the file into a list of chunks and then building the XML tree from the chunks. Not really intended for extensive use. Use the interface function get_xml_tree() instead. This is a helper class for the implementation of the functionality in get_xml_tree()
XML_Node * XML_Mini::build_tree | ( | ) |
Constructs an XML tree out of a list of chunks perviously collected using read_file(). Here is the algorithm:
size_t XML_Mini::read_file | ( | std::string | fl | ) |
Reads an XML file specified by its name and makes a list of Chunk objects out of it. Each of these chunks, by construction, either does not contain any < or > tags, or they appear simultaneously as the first and last characters respectively.