|
#include <CXmlDoc.h>

Public Member Functions | |
| CXmlDoc () | |
| Constructs an empty document, without doctype. | |
| CXmlDoc (const char *name, const char *public_id=0, const char *system_id=0) | |
| virtual | ~CXmlDoc () |
| Destructor. | |
| virtual CXmlNodeType | type () const |
| Returns node type. | |
| virtual void | clear () |
| Destroys all nodes in document. | |
| virtual const std::string & | name () const |
| Returns the node name. | |
| virtual void | name (const std::string &name) |
| Sets the new name for the node. | |
| virtual void | name (const char *name) |
| Sets new name for node. | |
| CXmlDocType & | docType () |
| const CXmlDocType & | docType () const |
| CXmlNode * | rootNode () |
| Returns pointer to root element of document. | |
| virtual void | load (const char *buffer) |
| virtual void | load (const CBuffer &buffer) |
| virtual void | save (CBuffer &buffer, int indent=0) const |
Static Public Member Functions | |
| static int | indentSpaces () |
| Returns indentation in save. | |
| static void | indentSpaces (int i) |
| Set indentation in save, defaults to 2. | |
Protected Member Functions | |
| CXmlNode * | createElement (const char *tagname) |
Protected Attributes | |
| CBuffer | m_decodeBuffer |
| Decode and encode buffer. | |
Friends | |
| class | CXmlNode |
Represents the entire XML document. It provides access to document root node, which includes all nodes in XML document tree.
| sptk::CXmlDoc::CXmlDoc | ( | const char * | name, | |
| const char * | public_id = 0, |
|||
| const char * | system_id = 0 | |||
| ) |
Constructs an empty document, with doctype.
| name | const char *, name of the document. | |
| public_id | const char *, public id of the document, placed on DOCTYPE declaration | |
| system_id | const char *, system id of the document, placed on DOCTYPE declaration |
| CXmlNode* sptk::CXmlDoc::createElement | ( | const char * | tagname | ) | [protected] |
Creates new named node of type CXmlNode::DOM_ELEMENT. It can be added to document DOM tree.
| tagname | const char *, name of the element |
| const CXmlDocType& sptk::CXmlDoc::docType | ( | ) | const [inline] |
Returns doctype of document. You can use it to add e.g. custom entities.
mydoc->doctype().set_entity("myentity", "myreplacement");
| CXmlDocType& sptk::CXmlDoc::docType | ( | ) | [inline] |
Returns doctype of document. You can use it to add e.g. custom entities.
mydoc->doctype().set_entity("myentity", "myreplacement");
| static void sptk::CXmlDoc::indentSpaces | ( | int | i | ) | [inline, static] |
Set indentation in save, defaults to 2.
| i | as new indent spaces |
| virtual void sptk::CXmlDoc::load | ( | const CBuffer & | buffer | ) | [inline, virtual] |
Loads document from buffer.
| buffer | const CBuffer&, source buffer |
Reimplemented in sptk::CRegistry.
References sptk::CBuffer::c_str(), and load().
| virtual void sptk::CXmlDoc::load | ( | const char * | buffer | ) | [virtual] |
Loads document from buffer.
| buffer | const char*, source buffer |
Reimplemented in sptk::CRegistry.
Referenced by load(), and sptk::CRegistry::load().
| virtual void sptk::CXmlDoc::name | ( | const char * | name | ) | [inline, virtual] |
Sets new name for node.
| name | const char *, new node name |
Reimplemented from sptk::CXmlNamedItem.
| virtual void sptk::CXmlDoc::name | ( | const std::string & | name | ) | [inline, virtual] |
Sets the new name for the node.
| name | const std::string&, new node name |
Reimplemented from sptk::CXmlNamedItem.
| virtual const std::string& sptk::CXmlDoc::name | ( | ) | const [inline, virtual] |
Returns the node name.
The meaning of the value depends on the node type
Reimplemented from sptk::CXmlNamedItem.
| virtual void sptk::CXmlDoc::save | ( | CBuffer & | buffer, | |
| int | indent = 0 | |||
| ) | const [virtual] |
Saves document to buffer.
| buffer | CBuffer&, a buffer to save document | |
| indent | int, how many indent spaces at start |
Reimplemented from sptk::CXmlNode.
Reimplemented in sptk::CRegistry.
Referenced by sptk::CRegistry::save().