PandA-2024.02
Public Member Functions | Private Attributes
xml_child Class Reference

#include <xml_node.hpp>

Inheritance diagram for xml_child:
Inheritance graph
[legend]
Collaboration diagram for xml_child:
Collaboration graph
[legend]

Public Member Functions

 xml_child (const std::string &_name)
 constructor More...
 
void print (std::ostream &os, bool formatted, simple_indent *pp) const override
 Print the class. More...
 
xml_elementadd_child_element (const std::string &name)
 Add a child element to this node. More...
 
xml_elementadd_child_element (const xml_nodeRef &node)
 Add a child element to this node starting from a given node. More...
 
xml_text_nodeadd_child_text (const std::string &content)
 Append a new text node. More...
 
xml_text_nodeget_child_text ()
 Get the first child text content node. More...
 
const xml_text_nodeget_child_text () const
 Get the first child text content node. More...
 
xml_comment_nodeadd_child_comment (const std::string &content)
 Append a new comment node. More...
 
xml_att_decl_nodeadd_child_attribute_declaration (const std::string &name)
 Append a new attribute declaration node. More...
 
void remove_child (xml_node *el)
 Remove the child node. More...
 
node_list const & get_children ()
 Obtain the list of child nodes. More...
 
const node_listget_children () const
 Obtain the list of child nodes. More...
 
bool has_child () const
 
const CustomSet< xml_nodeRef > CGetDescendants (const std::string &path) const
 Return the set of descendants with a specific path. More...
 
- Public Member Functions inherited from xml_node
 xml_node (const std::string &_name)
 constructor More...
 
virtual ~xml_node ()=default
 destructor More...
 
std::string get_name () const
 Get the name of this node. More...
 
void set_name (const std::string &_name)
 Set the name of this node. More...
 
int get_line () const
 Discover at what line number this node occurs in the XML file. More...
 
void set_line (int _line)
 Set the line this node occurs in the XML file. More...
 

Private Attributes

node_list child_list
 
xml_text_nodefirst_text
 

Additional Inherited Members

- Public Types inherited from xml_node
using node_list = std::list< xml_nodeRef >
 type for list of xml nodes More...
 
- Static Public Member Functions inherited from xml_node
static void convert_unescaped (std::string &ioString)
 Convert unescaped characters. More...
 
static void convert_escaped (std::string &ioString)
 Convert escaped characters. More...
 

Detailed Description

Definition at line 227 of file xml_node.hpp.

Constructor & Destructor Documentation

◆ xml_child()

xml_child::xml_child ( const std::string &  _name)
inlineexplicit

constructor

Definition at line 233 of file xml_node.hpp.

Member Function Documentation

◆ add_child_attribute_declaration()

xml_att_decl_node * xml_child::add_child_attribute_declaration ( const std::string &  name)

Append a new attribute declaration node.

Parameters
nameThe name of the declaration.
Returns
The new attribute declaration node.

Definition at line 88 of file xml_node.cpp.

References child_list.

◆ add_child_comment()

xml_comment_node * xml_child::add_child_comment ( const std::string &  content)

Append a new comment node.

Parameters
contentThe text. This should be unescaped - see xml_comment_node::set_content().
Returns
The new comment node.

Definition at line 80 of file xml_node.cpp.

References child_list.

◆ add_child_element() [1/2]

xml_element * xml_child::add_child_element ( const std::string &  _name)

◆ add_child_element() [2/2]

xml_element * xml_child::add_child_element ( const xml_nodeRef &  node)

Add a child element to this node starting from a given node.

Parameters
nodeis the given data-structure to be added
Returns
The newly-created element

Definition at line 62 of file xml_node.cpp.

References child_list.

◆ add_child_text()

xml_text_node * xml_child::add_child_text ( const std::string &  content)

Append a new text node.

Parameters
contentThe text. This should be unescaped - see ContentNode::set_content().
Returns
The new text node.

Definition at line 68 of file xml_node.cpp.

References child_list, and first_text.

Referenced by attribute::xwrite(), library_manager::xwrite(), structural_object::xwrite(), functional_unit::xwrite(), functional_unit_template::xwrite(), port_o::xwrite(), module::xwrite(), and RTLCharacterization::xwrite_characterization().

Here is the caller graph for this function:

◆ CGetDescendants()

const CustomSet< xml_nodeRef > xml_child::CGetDescendants ( const std::string &  path) const

Return the set of descendants with a specific path.

Parameters
pathis the / separated list of the tags to be crossed from the current node to the ancestor
Returns
the set of xml nodes

Definition at line 106 of file xml_node.cpp.

References get_children(), level, and SplitString().

Here is the call graph for this function:

◆ get_child_text() [1/2]

xml_text_node* xml_child::get_child_text ( )
inline

Get the first child text content node.

This is a convenience method, meant as an alternative to iterating over all the child nodes to find the first suitable node then and getting the text directly.

Returns
The first text node, if any.

Definition at line 272 of file xml_node.hpp.

Referenced by xml_element::print(), and attribute::xload().

Here is the caller graph for this function:

◆ get_child_text() [2/2]

const xml_text_node* xml_child::get_child_text ( ) const
inline

Get the first child text content node.

This is a convenience method, meant as an alternative to iterating over all the child nodes to find the first suitable node then and getting the text directly.

Returns
The first text node, if any.

Definition at line 282 of file xml_node.hpp.

◆ get_children() [1/2]

node_list const& xml_child::get_children ( )
inline

Obtain the list of child nodes.

Returns
The list of child nodes.

Definition at line 310 of file xml_node.hpp.

Referenced by HLS_constraints::add_builtin_constraints(), CGetDescendants(), HLS_device::factory(), get_connections(), Translator::get_normalization(), HLS_constraints::HLS_constraints(), Parameter::load_xml_configuration_file(), Parameter::load_xml_configuration_file_rec(), DataXmlParser::Parse(), BackendFlow::parse_flow(), TestVectorParser::ParseXMLFile(), xml_element::print(), Translator::read_column_formats(), HLS_constraints::read_HLS_constraints_File(), CompilerWrapper::readExternalSymbols(), CompilerWrapper::ReadXml(), XilinxBackendFlow::vivado_xparse_utilization(), Translator::write_to_latex(), generic_device::xload(), attribute::xload(), BackendFlow::xload(), hls::xload(), library_manager::xload(), HLS_constraints::xload(), SynthesisTool::xload(), technology_manager::xload(), structural_manager::xload(), operation::xload(), structural_object::xload(), functional_unit::xload(), functional_unit_template::xload(), port_o::xload(), action_o::xload(), signal_o::xload(), module::xload(), channel_o::xload(), generic_device::xload_device_parameters(), SynthesisTool::xload_scripts(), xml_command_t::xml_command_t(), xml_foreach_t::xml_foreach_t(), xml_ite_block_t::xml_ite_block_t(), xml_parameter_t::xml_parameter_t(), xml_set_variable_t::xml_set_variable_t(), xml_shell_t::xml_shell_t(), XilinxBackendFlow::xparse_timing(), AlteraBackendFlow::xparse_utilization(), LatticeBackendFlow::xparse_utilization(), BashBackendFlow::xparse_utilization(), NanoXploreBackendFlow::xparse_utilization(), and XilinxBackendFlow::xparse_xst_utilization().

Here is the caller graph for this function:

◆ get_children() [2/2]

const node_list& xml_child::get_children ( ) const
inline

Obtain the list of child nodes.

Returns
The list of child nodes.

Definition at line 318 of file xml_node.hpp.

◆ has_child()

bool xml_child::has_child ( ) const
inline
Returns
Whether this node has children, or is empty.

Definition at line 326 of file xml_node.hpp.

Referenced by xml_element::print().

Here is the caller graph for this function:

◆ print()

void xml_child::print ( std::ostream &  os,
bool  formatted,
simple_indent pp 
) const
inlineoverridevirtual

Print the class.

Implements xml_node.

Definition at line 240 of file xml_node.hpp.

References xml_node::name.

Referenced by xml_element::print(), and xml_document::print().

Here is the caller graph for this function:

◆ remove_child()

void xml_child::remove_child ( xml_node el)
inline

Remove the child node.

Parameters
elThe child node to remove. This Node will be deleted and therefore unusable after calling this method.

Definition at line 302 of file xml_node.hpp.

Field Documentation

◆ child_list

node_list xml_child::child_list
private

◆ first_text

xml_text_node* xml_child::first_text
private

Definition at line 340 of file xml_node.hpp.

Referenced by add_child_text().


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

Generated on Mon Feb 12 2024 13:04:11 for PandA-2024.02 by doxygen 1.8.13