Rudiments
|
#include <dom.h>
Inherits collection.
Inherited by csvdom, inidom, jsondom, propdom, and xmldom.
The dom class implements a minimal DOM-style parser.
dom::dom | ( | ) |
Creates a new instance of the dom class.
dom::dom | ( | bool | stringcacheenabled | ) |
Creates a new instance of the dom class, allowing the user to enable or disable the "string cache" for this instance.
By default, as each domnode is added to the dom tree, tag and attribute names and values are stored in a string cache and pointers into the cache are assigned to each node. Reference counters are kept and the string is removed from the cache when no more nodes are using it. If the data is highly repetitive this conserves memory at the cost of speed.
If the string cache is disabled then memory is allocated in each domnode for names and values and freed when the domnode is freed. This is faster but uses much more memory.
|
virtual |
Deletes this instance of the dom class.
bool dom::getStringCacheEnabled | ( | ) |
Returns true if the string cache is enabled and false if it is disabled.
|
virtual |
Writes a representation of the DOM tree to standard output.
Implements collection.
Writes a representation of the DOM tree to standard output.
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is output as-is.
Writes a representation of the DOM tree to "out".
Implements collection.
Writes a representation of the DOM tree to "out".
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is output as-is.
Writes the DOM tree to "filename" and sets permissions of the file to "perms".
Writes the DOM tree to "filename" and sets permissions of the file to "perms".
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is output as-is.
|
virtual |
Writes an XML representation of the DOM tree to standard output.
Writes an XML representation of the DOM tree to standard output.
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is written without indentation.
Writes an XML representation of the DOM tree to "out".