Public Types | |
typedef boost::shared_ptr< XmlDocument > | XmlDocumentPtr |
Type of XmlDocumentPtr;. | |
Public Member Functions | |
XmlNode * | findNode (const std::vector< unsigned int > &dnaCode) |
Returns the node with the given "DNA" code, see http://www.geocities.com/polterguy1000/ for a description of what a "DNA" code is. | |
XmlNode::XmlNodePtr | getDocumentNode () |
Returns the "document node". | |
SmartUtil::tstring | toNormalizedString () const |
Returns a string representation of the XML document. | |
SmartUtil::tstring | toString () const |
Returns a string representation of the XML document. | |
XmlDocument (std::basic_istream< TCHAR > &stream) | |
Constructor creating an XML document from a stream. | |
XmlDocument (const SmartUtil::tstring &docNodeName, const SmartUtil::tstring &docNodeContent, const SmartUtil::tstring &docNodeNamespace, const SmartUtil::tstring &version=_T("1.0"), const SmartUtil::tstring &encoding=_T("utf-8")) | |
Constructor creating a new XmlDocument object. | |
Static Public Member Functions | |
static XmlDocumentPtr | createDocument (std::basic_istream< TCHAR > &stream) |
Static constructor taking an istream from which it loads the document from. | |
Friends | |
std::basic_ostream< TCHAR > & | operator<< (std::basic_ostream< TCHAR > &, const XmlDocument &writer) |
An XML document can be written to any ostream through usage of the insertion operator (<<). |
You cannot have an XmlNode (which kind of like is the "content" of an XML document) without having an XML document. This class encapsulates an XML document in most ways such that all manipulation of XML documents can (and should) be done through this class!
XmlDocument | ( | const SmartUtil::tstring & | docNodeName, | |
const SmartUtil::tstring & | docNodeContent, | |||
const SmartUtil::tstring & | docNodeNamespace, | |||
const SmartUtil::tstring & | version = _T("1.0") , |
|||
const SmartUtil::tstring & | encoding = _T("utf-8") | |||
) |
Constructor creating a new XmlDocument object.
Since all XML documents must have a "root node" this constructor ensures that the document is created with a root node and that no XmlDocument can exist WITHOUT an XML Document Node
XmlDocument | ( | std::basic_istream< TCHAR > & | stream | ) | [explicit] |
Constructor creating an XML document from a stream.
XML document is loaded from the given stream and built up from that
XmlNode::XmlNodePtr getDocumentNode | ( | ) |
Returns the "document node".
The document node is the "root node" or the node which is the "ancestor" of all other nodes in the document. All manipulation of the document is done through the "document node", adding nodes, deleting nodes and so on, but the "document node" cannot be changed after the document is created!
SmartUtil::tstring toNormalizedString | ( | ) | const |
Returns a string representation of the XML document.
Returns a string representation of the XML document after it has been created!
SmartUtil::tstring toString | ( | ) | const |
Returns a string representation of the XML document.
Returns a string representation of the XML document after it has been created!