Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
UtilsXML Class Reference

Functions for manipulating XML structures. More...

#include <UtilsXML.h>

Public Member Functions

static N::xml_tag_t const DRAIN_XML_TREE (N)
 
static N::xml_tag_t const DRAIN_XML_TREE (N)
 

Static Public Member Functions

template<typename TX >
static TX & setType (TX &tree, const typename TX::node_data_t::xml_tag_t &type)
 
template<typename TX , typename ... TT>
static TX & setTypeAndID (TX &tree, const typename TX::node_data_t::xml_tag_t &type, const TT &...args)
 
template<typename N >
static N::xml_tag_t retrieveDefaultType (const N &parentNode)
 Find node type (tag id) from a predefined list of default types for (some) parent types.
 
template<typename T >
static bool initChildWithDefaultType (const T &tree, T &child)
 
template<typename T >
static T & assign (T &dst, const T &src)
 Assign another tree structure to another.
 
template<typename TX >
static TX & assign (TX &dst, const typename TX::xml_node_t &src)
 Copy node data to tree.
 
template<typename T , typename V >
static T & assign (T &tree, const V &arg)
 Assign property to a XML tree node.
 
template<typename T >
static T & assign (T &tree, std::initializer_list< std::pair< const char *, const Variable > > l)
 Tree.
 
template<typename TX >
static TX & assignString (TX &tree, const std::string &s)
 When assigning a string, create new element unless the element itself is of type CTEXT.
 
template<typename TX >
static TX & appendString (TX &tree, const std::string &s)
 
template<typename N >
static DRAIN_XML_TREE (N) &getHeaderObject(DRAIN_XML_TREE(N) &root
 
template<typename N >
static DRAIN_XML_TREE (N) &appendHeaderObject(DRAIN_XML_TREE(N) &root
 
template<typename T >
static T & ensureStyleElem (T &elem)
 If element is of type STYLE, return it. If not, return header object of type STYLE.
 
template<typename T , typename S >
static T & ensureStyle (T &elem, const S &selector, const std::initializer_list< std::pair< const char *, const Variable > > &styleDef)
 

Public Attributes

static N::xml_tag_t tag
 

Detailed Description

Functions for manipulating XML structures.

Member Function Documentation

◆ assign() [1/4]

template<typename T >
static T & assign ( T &  dst,
const T &  src 
)
inlinestatic

Assign another tree structure to another.

Template Parameters
XML- xml tree structure (TreeXML, TreeSVG, TreeHTML)

◆ assign() [2/4]

template<typename T , typename V >
static T & assign ( T &  tree,
const V &  arg 
)
inlinestatic

Assign property to a XML tree node.

Template Parameters
T- XML tree

◆ assign() [3/4]

template<typename T >
static T & assign ( T &  tree,
std::initializer_list< std::pair< const char *, const Variable > >  l 
)
inlinestatic

Tree.

Template Parameters
TX- xml tree

◆ assign() [4/4]

template<typename TX >
static TX & assign ( TX &  dst,
const typename TX::xml_node_t &  src 
)
inlinestatic

Copy node data to tree.

Template Parameters
XML- xml tree structure (TreeXML, TreeSVG, TreeHTML)

◆ assignString()

template<typename TX >
static TX & assignString ( TX &  tree,
const std::string &  s 
)
inlinestatic

When assigning a string, create new element unless the element itself is of type CTEXT.

Returns
- text element (CTEXT): current or child element of the current element

Forward definition – type can be set only upon construction of a complete class

◆ ensureStyle()

template<typename T , typename S >
static T & ensureStyle ( T &  elem,
const S &  selector,
const std::initializer_list< std::pair< const char *, const Variable > > &  styleDef 
)
inlinestatic

Some compilers need this polymorphism.

◆ ensureStyleElem()

template<typename T >
static T & ensureStyleElem ( T &  elem)
inlinestatic

If element is of type STYLE, return it. If not, return header object of type STYLE.

The header object is in standard

Template Parameters
T- XML tree type
Parameters
elem

◆ initChildWithDefaultType()

template<typename T >
static bool initChildWithDefaultType ( const T &  tree,
T &  child 
)
inlinestatic

This is typically invoked by Tree ::initChild(Tree & child)

◆ setType()

template<typename TX >
static TX & setType ( TX &  tree,
const typename TX::node_data_t::xml_tag_t &  type 
)
inlinestatic

Forward definition – type can be set only upon construction of a complete class


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