Supports simple XML output with consistency checking.
basis::outcome add_content(const basis::astring &content)
stores content into the currently opened tag.
static basis::astring clean_reserved(const basis::astring &to_modify, bool replace_spaces=false)
returns a cleaned version of "to_modify" to make it XML appropriate.
static const char * outcome_name(const basis::outcome &to_name)
reports the string version of "to_name".
static void clean_reserved_mod(basis::astring &to_modify, bool replace_spaces=false)
ensures that "to_modify" contains only characters valid for XML.
basis::outcome close_tag(const basis::astring &tag_name)
closes a previously added "tag_name".
DEFINE_CLASS_NAME("xml_generator")
outcomes
the possible ways that operations here can complete.
basis::outcome open_tag(const basis::astring &tag_name, const structures::string_table &attributes)
adds a tag with "tag_name" and the "attributes", if any.
basis::astring generate()
writes the current state into a string and returns it.
basis::outcome add_header(const basis::astring &tag_name, const structures::string_table &attributes)
adds an xml style header with the "tag_name" and "attributes".
void close_all_tags()
a wide-bore method that closes all outstanding tags.
void reset()
throws out all accumulated information.
void set_indentation(int to_indent)
sets the number of spaces to indent for the human readable form.