BLib Reference Manual |
---|
BWriter — writes XML files
struct BWriter; BWriter* b_writer_new (FILE *stream, gint indent); void b_writer_free (BWriter *writer); void b_write_header (BWriter *writer, const gchar *encoding); void b_write_open_tag (BWriter *writer, const gchar *tag, ...); void b_write_close_tag (BWriter *writer, const gchar *tag); void b_write_element (BWriter *writer, const gchar *tag, const gchar *value, ...);
BWriter* b_writer_new (FILE *stream, gint indent);
Creates a new BWriter which gives a convenient interface to write XML data to stream. The writer should later be freed using b_writer_free().
stream : | a FILE stream prepared for writing |
indent : | how many characters to indent per nesting level |
Returns : | a newly allocate BWriter |
void b_writer_free (BWriter *writer);
Frees the resources allocated for writer. You must not access writer after calling this function.
writer : | a BWriter |
void b_write_header (BWriter *writer, const gchar *encoding);
Writes an XML header to the stream associated with writer.
writer : | a BWriter |
encoding : | an optional encoding string or NULL |
void b_write_open_tag (BWriter *writer, const gchar *tag, ...);
Writes an opening XML tag with the element name tag to the stream associated with writer. You can pass a NULL-terminated list of key/value pairs that are written out as attributes.
writer : | a BWriter |
tag : | the name of the element to open |
... : | an optional key/value pairs interpreted as attributes |
void b_write_close_tag (BWriter *writer, const gchar *tag);
Writes a closing XML tag with the element name tag to the stream associated with writer.
writer : | a BWriter |
tag : | the name of the element to close |
void b_write_element (BWriter *writer, const gchar *tag, const gchar *value, ...);
Writes an XML element with the name tag and the value value to the stream associated with writer. If value is NULL, an empty element is written. You can pass a NULL-terminated list of key/value pairs that are written out as attributes.
writer : | a BWriter |
tag : | the element name |
value : | the element value |
... : | an optional key/value pairs interpreted as attributes |
<< BParser | Blinkenlights Movies >> |