GCC Middle and Back End API Reference
xml::element Struct Reference

#include <xml.h>

Inheritance diagram for xml::element:
Collaboration diagram for xml::element:

Public Member Functions

 element (std::string kind, bool preserve_whitespace)
void write_as_xml (pretty_printer *pp, int depth, bool indent) const final override
void set_attr (const char *name, std::string value)
void add_child (std::unique_ptr< node > node)
void add_text (std::string str)
void add_text_from_pp (pretty_printer &pp)
virtual textdyn_cast_text ()
void dump (FILE *out) const
void DEBUG_FUNCTION dump () const

Data Fields

std::string m_kind
bool m_preserve_whitespace
std::map< std::string, std::string > m_attributes
std::vector< std::string > m_key_insertion_order
std::vector< std::unique_ptr< node > > m_children

Constructor & Destructor Documentation

◆ element()

xml::element::element ( std::string kind,
bool preserve_whitespace )
inline

References m_kind, and m_preserve_whitespace.

Member Function Documentation

◆ add_child()

void xml::node_with_children::add_child ( std::unique_ptr< node > node)
inherited

◆ add_text()

void xml::node_with_children::add_text ( std::string str)
inherited

References add_child(), and m_children.

Referenced by xml::printer::add_text(), and add_text_from_pp().

◆ add_text_from_pp()

void xml::node_with_children::add_text_from_pp ( pretty_printer & pp)
inherited

◆ dump() [1/2]

void DEBUG_FUNCTION xml::node::dump ( ) const
inlineinherited

References DEBUG_FUNCTION, and dump().

Referenced by dump().

◆ dump() [2/2]

void xml::node::dump ( FILE * out) const
inherited

◆ dyn_cast_text()

virtual text * xml::node::dyn_cast_text ( )
inlinevirtualinherited

Reimplemented in xml::text.

◆ set_attr()

void xml::element::set_attr ( const char * name,
std::string value )

◆ write_as_xml()

void xml::element::write_as_xml ( pretty_printer * pp,
int depth,
bool indent ) const
finaloverridevirtual

Field Documentation

◆ m_attributes

std::map<std::string, std::string> xml::element::m_attributes

Referenced by set_attr(), and write_as_xml().

◆ m_children

std::vector<std::unique_ptr<node> > xml::node_with_children::m_children
inherited

◆ m_key_insertion_order

std::vector<std::string> xml::element::m_key_insertion_order

Referenced by set_attr(), and write_as_xml().

◆ m_kind

std::string xml::element::m_kind

Referenced by element(), and write_as_xml().

◆ m_preserve_whitespace

bool xml::element::m_preserve_whitespace

Referenced by element(), and write_as_xml().


The documentation for this struct was generated from the following files: