Rudiments
|
Public Member Functions | |
csvdom () | |
csvdom (bool stringcacheenabled) | |
virtual | ~csvdom () |
bool | parseFile (const char *filename) |
bool | parseString (const char *string) |
void | createRootNode () |
bool | write (output *out, bool indent) const |
![]() | |
csvsax () | |
virtual | ~csvsax () |
void | setQuote (char quote) |
char | getQuote () const |
void | setDelimiter (char delimiter) |
char | getDelimiter () const |
![]() | |
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) const |
bool | stringCacheEnabled () |
Protected Member Functions | |
virtual bool | headerStart () |
virtual bool | column (const char *name, bool quoted) |
virtual bool | headerEnd () |
virtual bool | bodyStart () |
virtual bool | rowStart () |
virtual bool | field (const char *value, bool quoted) |
virtual bool | rowEnd () |
virtual bool | bodyEnd () |
The csvdom class implements a minimal CSV DOM parser.
csvdom::csvdom | ( | ) |
Creates a new instance of the csvdom class.
csvdom::csvdom | ( | bool | stringcacheenabled | ) |
Creates a new instance of the csvdom class, allowing the user to enable or disable the "string cache" for this instance.
By default, as each csvdomnode is added to the csvdom 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. As csv tends to be highly repetitive this conserves memory at the cost of speed.
If the string cache is disabled then memory is allocated in each csvdomnode for names and values and freed when the csvdomnode is freed. This is faster but uses much more memory.
|
virtual |
Deletes this instance of the csvdom class.
|
protectedvirtual |
Gets called when the end of the body is encountered.
Reimplemented from csvsax.
|
protectedvirtual |
Gets called when the start of the body is encountered.
Reimplemented from csvsax.
Gets called when a column name is parsed.
Reimplemented from csvsax.
|
virtual |
Creates a new root node. This is useful for building a tree from scratch.
Reimplemented from dom.
Gets called when a field is parsed.
Reimplemented from csvsax.
|
protectedvirtual |
Gets called when the end of the header is encountered.
Reimplemented from csvsax.
|
protectedvirtual |
Gets called when the start of the header is encountered.
Reimplemented from csvsax.
|
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 the end of a row is encountered.
Reimplemented from csvsax.
|
protectedvirtual |
Gets called when the start of a row is encountered.
Reimplemented from csvsax.