GCC Middle and Back End API Reference
|
#include <xml-printer.h>
Public Member Functions | |
printer (element &insertion_point, bool check_popped_tags=true) | |
void | push_tag (std::string name, bool preserve_whitespace=false) |
void | push_tag_with_class (std::string name, std::string class_, bool preserve_whitespace=false) |
void | pop_tag (const char *expected_name) |
void | set_attr (const char *name, std::string value) |
void | add_text (std::string text) |
void | add_text_from_pp (pretty_printer &pp) |
void | add_raw (std::string text) |
void | push_element (std::unique_ptr< element > new_element) |
void | append (std::unique_ptr< node > new_node) |
element * | get_insertion_point () const |
size_t | get_num_open_tags () const |
void DEBUG_FUNCTION | dump () const |
Private Attributes | |
std::vector< element * > | m_open_tags |
bool | m_check_popped_tags |
A class for creating XML trees by appending to an insertion point, with a stack of open tags.
References m_check_popped_tags, and m_open_tags.
void xml::printer::add_raw | ( | std::string | text | ) |
References xml::node_with_children::add_child(), and m_open_tags.
void xml::printer::add_text | ( | std::string | text | ) |
References xml::node_with_children::add_text(), and m_open_tags.
Referenced by state_diagram::add_title_tr(), diagnostics::to_text::layout_printer< to_text >, and state_diagram::on_node_in_table().
void xml::printer::add_text_from_pp | ( | pretty_printer & | pp | ) |
References xml::node_with_children::add_text_from_pp(), and m_open_tags.
void xml::printer::append | ( | std::unique_ptr< node > | new_node | ) |
References xml::node_with_children::add_child(), gcc_assert, and m_open_tags.
void xml::printer::dump | ( | ) | const |
References m_open_tags, pp_flush(), pp_newline(), pp_printf(), and pretty_printer::set_output_stream().
element * xml::printer::get_insertion_point | ( | ) | const |
References m_open_tags.
Referenced by pop_tag().
|
inline |
References m_open_tags.
void xml::printer::pop_tag | ( | const char * | expected_name | ) |
Pop the current topmost tag. If m_check_popped_tags, assert that the tag we're popping is EXPECTED_NAME.
References gcc_assert, get_insertion_point(), m_check_popped_tags, and m_open_tags.
Referenced by state_diagram::add_title_tr(), diagnostics::to_text::layout_printer< to_text >, state_diagram::on_node_in_table(), and state_diagram::pop_src_text().
void xml::printer::push_element | ( | std::unique_ptr< element > | new_element | ) |
References xml::node_with_children::add_child(), gcc_assert, and m_open_tags.
Referenced by push_tag(), and push_tag_with_class().
References push_element().
Referenced by state_diagram::add_title_tr(), state_diagram::on_node_in_table(), and state_diagram::push_src_text().
void xml::printer::push_tag_with_class | ( | std::string | name, |
std::string | class_, | ||
bool | preserve_whitespace = false ) |
References push_element().
Referenced by diagnostics::to_text::layout_printer< to_text >.
void xml::printer::set_attr | ( | const char * | name, |
std::string | value ) |
|
private |
Referenced by add_raw(), add_text(), add_text_from_pp(), append(), dump(), get_insertion_point(), get_num_open_tags(), pop_tag(), printer(), push_element(), and set_attr().