1 #ifndef XML_GENERATOR_CLASS
2 #define XML_GENERATOR_CLASS
46 OKAY = basis::common::OKAY,
101 bool replace_spaces =
false);
107 bool replace_spaces =
false);
119 enum open_types { NORMAL_TAG, HEADER_TAG };
120 void print_open_tag(
const tag_info &to_print,
int type = NORMAL_TAG);
Provides a dynamically resizable ASCII character string.
Outcomes describe the state of completion for an operation.
Provides a symbol_table that holds strings as the content.
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.
xml_generator(int modifiers=HUMAN_READABLE|CLEAN_ILLEGAL_CHARS)
creates an xml generator with the specified behavior.
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.