Collection of functions for investigating and processing trees.
More...
#include <TreeUtils.h>
|
template<class TR , class S > |
static void | getPaths (const TR &tree, S &container) |
| Retrieve all the paths.
|
|
template<class TR , class S > |
static void | getPaths (const TR &tree, S &container, const typename TR::path_t &path) |
| Retrieve all the paths.
|
|
template<class T1 , class T2 > |
static void | deepCopy (const T1 &srcTree, T2 &dstTree) |
|
template<class T , class H > |
static void | traverse (H &visitor, T &tree, const typename T::path_t &path=typename T::path_t()) |
| Traverse tree, visiting each node as a prefix operation.
|
|
template<class T > |
static bool | dataDumper (const T &data, std::ostream &ostr) |
| Default implementation for recursive dump()
|
|
template<class TR , bool SKIP_EMPTY = false> |
static bool | dump (const TR &tree, std::ostream &ostr=std::cout, bool(*callBack)(const typename TR::node_data_t &, std::ostream &)=TreeUtils::dataDumper, const std::string &indent="") |
| Render a tree using character graphics.
|
|
template<class TR > |
static void | dumpContents (const TR &tree, std::ostream &ostr=std::cout, const typename TR::path_t &path="") |
| Debugging utility - dumps the tree, also the contents.
|
|
template<class TR > |
static void | writeINI (const TR &t, std::ostream &ostr=std::cout, const typename TR::path_t &prefix=typename TR::path_t()) |
| Write a Windows INI file.
|
|
template<class TR > |
static void | readINI (TR &tree, std::istream &istr) |
|
Collection of functions for investigating and processing trees.
- Template Parameters
-
K | - key type, implementing method empty() and cast from/to std::string. |
T | - value type |
C | - comparison functor, implementing less-than relation |
◆ dump()
template<class TR , bool SKIP_EMPTY = false>
static bool dump |
( |
const TR & |
tree, |
|
|
std::ostream & |
ostr = std::cout , |
|
|
bool(*)(const typename TR::node_data_t &, std::ostream &) |
callBack = TreeUtils::dataDumper , |
|
|
const std::string & |
indent = "" |
|
) |
| |
|
inlinestatic |
Render a tree using character graphics.
Debugging utility - dumps the structure of the tree (not the contents).
- Template Parameters
-
TR | - tree type |
SKIP | - skip empty branches (FUTURE OPTION) |
- Returns
- - true if empty, false if groups exist or data non-empty (FUTURE OPTION)
◆ getPaths() [1/2]
template<class TR , class S >
static void getPaths |
( |
const TR & |
tree, |
|
|
S & |
container |
|
) |
| |
|
inlinestatic |
Retrieve all the paths.
- Template Parameters
-
S | - container (STL Sequence) |
- Parameters
-
◆ getPaths() [2/2]
template<class TR , class S >
static void getPaths |
( |
const TR & |
tree, |
|
|
S & |
container, |
|
|
const typename TR::path_t & |
path |
|
) |
| |
|
inlinestatic |
Retrieve all the paths.
- Template Parameters
-
S | - container (STL Sequence) |
- Parameters
-
◆ traverse()
template<class T , class H >
static void traverse |
( |
H & |
visitor, |
|
|
T & |
tree, |
|
|
const typename T::path_t & |
path = typename T::path_t() |
|
) |
| |
|
inlinestatic |
Traverse tree, visiting each node as a prefix operation.
Simple version.
- Template Parameters
-
H | - object with method visitPrefix(tree, path) and visitPostfix(tree, path) |
T | - tree type, can be const |
- See also
- TreeVisitor<>
TODO: more codes than non-zero
The documentation for this class was generated from the following file: