PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
xml_node Class Referenceabstract

#include <xml_node.hpp>

Inheritance diagram for xml_node:
Inheritance graph
[legend]

Public Types

using node_list = std::list< xml_nodeRef >
 type for list of xml nodes More...
 

Public Member Functions

 xml_node (const std::string &_name)
 constructor More...
 
virtual ~xml_node ()=default
 destructor More...
 
virtual void print (std::ostream &os, bool formatted, simple_indent *pp) const =0
 Print the class. 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...
 

Static Public Member Functions

static void convert_unescaped (std::string &ioString)
 Convert unescaped characters. More...
 
static void convert_escaped (std::string &ioString)
 Convert escaped characters. More...
 

Private Attributes

std::string name
 name of the node More...
 
int line
 The line number in the XML file (not unsigned because lineno function of the lexer returns an int) More...
 

Friends

std::ostream & operator<< (std::ostream &os, const xml_node &s)
 Friend definition of the << operator. More...
 
std::ostream & operator<< (std::ostream &os, const xml_node *s)
 Friend definition of the << operator. More...
 
std::ostream & operator<< (std::ostream &os, const xml_nodeRef &s)
 Friend definition of the << operator. More...
 

Detailed Description

Definition at line 70 of file xml_node.hpp.

Member Typedef Documentation

◆ node_list

using xml_node::node_list = std::list<xml_nodeRef>

type for list of xml nodes

Definition at line 90 of file xml_node.hpp.

Constructor & Destructor Documentation

◆ xml_node()

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

constructor

Definition at line 83 of file xml_node.hpp.

References ~xml_node().

Here is the call graph for this function:

◆ ~xml_node()

virtual xml_node::~xml_node ( )
virtualdefault

destructor

Referenced by xml_node().

Here is the caller graph for this function:

Member Function Documentation

◆ convert_escaped()

static void xml_node::convert_escaped ( std::string &  ioString)
inlinestatic

Convert escaped characters.

Return a reference to the converted string. Supported characters are '&', '<', '>', "'", and '"'. Managed even strings with '
' character

Parameters
ioStringis the converted string.

Definition at line 197 of file xml_node.hpp.

Referenced by attribute::attribute(), structural_object::xload(), functional_unit_template::xload(), and module::xload().

Here is the caller graph for this function:

◆ convert_unescaped()

static void xml_node::convert_unescaped ( std::string &  ioString)
inlinestatic

Convert unescaped characters.

Return a reference to the converted string. Supported characters are '&', '<', '>', "'", and '"'.

Parameters
ioStringis the converted string.

Definition at line 162 of file xml_node.hpp.

Referenced by xml_text_node::print(), xml_comment_node::print(), and xml_attribute::print().

Here is the caller graph for this function:

◆ get_line()

int xml_node::get_line ( ) const

Discover at what line number this node occurs in the XML file.

Returns
The line number.

Definition at line 101 of file xml_node.cpp.

References line.

Referenced by set_name(), and structural_object::xload().

Here is the caller graph for this function:

◆ get_name()

std::string xml_node::get_name ( ) const
inline

◆ print()

virtual void xml_node::print ( std::ostream &  os,
bool  formatted,
simple_indent pp 
) const
pure virtual

Print the class.

Parameters
osis the stream.
formattedwhen true the xml is formatted in human readable way.
ppis the pretty print helper.

Implemented in xml_child, xml_attribute, xml_document, xml_element, xml_att_decl_node, xml_comment_node, and xml_text_node.

◆ set_line()

void xml_node::set_line ( int  _line)

Set the line this node occurs in the XML file.

Parameters
_lineThe line number.

Definition at line 96 of file xml_node.cpp.

References line.

Referenced by set_name().

Here is the caller graph for this function:

◆ set_name()

void xml_node::set_name ( const std::string &  _name)
inline

Set the name of this node.

Parameters
_nameThe new name for the node.

Definition at line 141 of file xml_node.hpp.

References get_line(), and set_line().

Referenced by BackendFlow::create_xml_scripts(), xml_comment_node::set_content(), and xml_text_node::set_content().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  os,
const xml_node s 
)
friend

Friend definition of the << operator.

Reference version

Definition at line 103 of file xml_node.hpp.

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  os,
const xml_node s 
)
friend

Friend definition of the << operator.

Pointer version

Definition at line 112 of file xml_node.hpp.

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  os,
const xml_nodeRef &  s 
)
friend

Friend definition of the << operator.

Refcount version

Definition at line 121 of file xml_node.hpp.

Field Documentation

◆ line

int xml_node::line
private

The line number in the XML file (not unsigned because lineno function of the lexer returns an int)

Definition at line 77 of file xml_node.hpp.

Referenced by get_line(), and set_line().

◆ name

std::string xml_node::name
private

name of the node

Definition at line 74 of file xml_node.hpp.

Referenced by get_name(), xml_child::print(), and attribute_sequence::set_attribute().


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