Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
TreePruner< T > Class Template Reference

#include <TreeUtilsXML.h>

Inheritance diagram for TreePruner< T >:
Inheritance graph
[legend]
Collaboration diagram for TreePruner< T >:
Collaboration graph
[legend]

Public Types

typedef std::map< typename T::node_data_t::xml_tag_t, short unsigned int > tag_selector_t
 

Public Member Functions

int visitPrefix (T &tree, const typename T::path_t &path) override
 Tasks to be executed before traversing child nodes.
 
int visitPostfix (T &tree, const typename T::path_t &path) override
 Tasks to be executed after traversing child nodes.
 

Public Attributes

tag_selector_t tagSelector
 

Detailed Description

template<class T>
class drain::TreePruner< T >

Example:

Remove all TEXT elements which have neither children neither own text.
textPruner.tagSelector[svg::TEXT] = drain::XmlEmptiness::TEXT | drain::XmlEmptiness::CHILDREN;
textPruner.tagSelector[svg::TSPAN] = drain::XmlEmptiness::TEXT;
textPruner.tagSelector[svg::UNDEFINED] = 0;
Definition TreeUtilsXML.h:104

Member Function Documentation

◆ visitPostfix()

template<class T >
int visitPostfix ( T &  tree,
const typename T::path_t &  path 
)
overridevirtual

Tasks to be executed after traversing child nodes.

Reimplemented from TreeVisitor< T >.

◆ visitPrefix()

template<class T >
int visitPrefix ( T &  tree,
const typename T::path_t &  path 
)
inlineoverridevirtual

Tasks to be executed before traversing child nodes.

Reimplemented from TreeVisitor< T >.


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