#include <xml.h>
Public Member Functions | |
XMLWriter () | |
Constructor. | |
XMLWriter (XMLWriter const &xw) | |
Copy constructor. | |
XMLWriter & | operator= (XMLWriter const &right) |
Assignment operator. | |
~XMLWriter () | |
Destructor. | |
bool | database (uint16_t version) |
Sets the database information. | |
bool | add_field (char const *name, uint16_t type, size_t size, uint16_t attrs, char const *defval) |
Adds a field to the database header. | |
bool | count (uint32_t count) |
Sets the number of records in the database. | |
bool | begin_record () |
Begins a record. | |
bool | add_value (char const *field, char const *value) |
Adds a value to the database data. | |
bool | add_ivalue (char const *field, int32_t value) |
Same as add_value(), but the value is an integer. | |
bool | add_uivalue (char const *field, uint32_t value) |
Same as add_value(), but the value is an unsigned integer. | |
bool | add_utvalue (char const *field, time_t value) |
Same as add_value(), but the value is a Unix timestamp. | |
bool | add_rivalue (char const *field, Record::identifier_type value) |
Same as add_value(), but the value is a record identifier. | |
bool | end_record () |
Ends a record. | |
void | dump_record () |
Frees the current record without adding it to the file. | |
bool | save (std::string const &filename) |
Saves the XML file. | |
char const * | error () const |
Returns the error that occured if save() returns false. |
|
Adds a field to the database header.
|
|
Adds a value to the database data.
|
|
Begins a record. All calls to add_value() and other record-related functions until end_record() is called is relative to this record.
|
|
Sets the number of records in the database.
|
|
Sets the database information.
|
|
Frees the current record without adding it to the file. Use this method if you don't wish to write a record for which begin_record() was already called. |
|
Ends a record. Must have been preceded by a call to begin_record() and one or more calls to add_value() and other related values.
|
|
Saves the XML file.
|