Rudiments
|
Public Member Functions | |
propdom () | |
propdom (bool stringcacheenabled) | |
virtual | ~propdom () |
bool | parseFile (const char *filename) |
bool | parseString (const char *string) |
void | createRootNode () |
virtual bool | write (output *out) const |
![]() | |
propsax () | |
virtual | ~propsax () |
![]() | |
sax () | |
virtual | ~sax () |
const char * | getError () |
![]() | |
dom () | |
dom (bool stringcacheenabled) | |
virtual | ~dom () |
virtual domnode * | getRootNode () const |
virtual domnode * | getNullNode () const |
virtual bool | writeFile (const char *filename, mode_t perms) const |
virtual bool | write (output *out, bool indent) const |
bool | stringCacheEnabled () |
Protected Member Functions | |
virtual bool | whitespaceStart () |
virtual bool | whitespace (const char *w) |
virtual bool | whitespaceEnd () |
virtual bool | exclamationCommentStart () |
virtual bool | exclamationComment (const char *c) |
virtual bool | exclamationCommentEnd () |
virtual bool | poundCommentStart () |
virtual bool | poundComment (const char *c) |
virtual bool | poundCommentEnd () |
virtual bool | keyStart () |
virtual bool | key (const char *k) |
virtual bool | keyEnd () |
virtual bool | equals (const char *e) |
virtual bool | valueStart () |
virtual bool | value (const char *v) |
virtual bool | valueEnd () |
The propdom class implements a minimal properties file DOM parser.
propdom::propdom | ( | ) |
Creates a new instance of the propdom class.
propdom::propdom | ( | bool | stringcacheenabled | ) |
Creates a new instance of the propdom class, allowing the user to enable or disable the "string cache" for this instance.
By default, as each domnode is added to the propdom 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 propdom class.
|
virtual |
Creates a new root node. This is useful for building a tree from scratch.
Reimplemented from dom.
|
protectedvirtual |
Gets called when the equality delimiter between a key and value is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when an exclamation-delimited comment is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the end of an exclamation-delimited comment is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the start of an exclamation-delimited comment is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when a key name is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the end of a key is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the start of a key is encountered.
Reimplemented from propsax.
|
virtual |
Parses file "filename" and generates a DOM tree.
Implements dom.
|
virtual |
Parses string "string" and generates a DOM tree.
Implements dom.
|
protectedvirtual |
Gets called when a pound-delimited comment is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the end of a pound-delimited comment is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the start of a pound-delimited comment is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when a value name is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the end of a value is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the start of a value is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when whitespace (outside of a comment, section name, key, or value) is parsed.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the end of whitespace (outside of a comment, section name, key, or value) is encountered.
Reimplemented from propsax.
|
protectedvirtual |
Gets called when the start of whitespace (outside of a comment, section name, key, or value) is encountered.
Reimplemented from propsax.