# XMLContentsPrinter Class Reference

This LogContentsPrinter implementation creates a XMLNodes mirroring the structure of passed Loggables. More...

`#include <XMLLogPrinter.h>`

Inheritance diagram for XMLContentsPrinter:

List of all members.

## Public Member Functions
| XMLContentsPrinter (unsigned int maxPrintingDepth)
| Constructor. Sets the value of m_maxPrintingDepth member.
void | LogContentInternal (const std::tstring &name, const SimpleLoggable &loggable)
| Adds a new XMLNode representing this SimpleLoggable to the parent node.
void | LogContentInternal (const std::tstring &name, const CompositeLoggable &loggable)
| Adds a new XMLNode representing this CompositeLoggable to the parent node.
void | SetRootXMLNode (XMLNode &node)
| Clears m_xmlNodeStack and pushes the passed node onto it.
## Private Attributes
std::vector< XMLNode * > | m_xmlNodeStack
| Stack of XMLNodes. Contains the currently processed node on top and all its parent nodes below, including the root node.
unsigned int | m_maxPrintingDepth
| m_xmlNodeStack height at which this XMLContentsPrinter should stop logging the contents of CompositeLoggables.

## Detailed Description

This LogContentsPrinter implementation creates a XMLNodes mirroring the structure of passed Loggables.

Definition at line 73 of file XMLLogPrinter.h.

## Member Function Documentation

void LogContentInternal | ( | const std::tstring & | name,
|  | const CompositeLoggable & | loggable |
| ) |  |  | `[inline, virtual]`

Adds a new XMLNode representing this CompositeLoggable to the parent node.

If the m_xmlNodeStack height doesn't exceed m_maxPrintingDepth, this new node is temporarily pushed onto the stack and the contents of this CompositeLoggable are printed on this XMLContentsPrinter recursively.

Implements LogContentsPrinter.

Definition at line 225 of file XMLLogPrinter.h.

References XMLNode::AddAttribute(), Loggable::GetHumanReadableTypeName(), CompositeLoggable::LogContentsOn(), XMLContentsPrinter::m_maxPrintingDepth, and XMLContentsPrinter::m_xmlNodeStack.

void LogContentInternal | ( | const std::tstring & | name,
|  | const SimpleLoggable & | loggable |
| ) |  |  | `[inline, virtual]`

Adds a new XMLNode representing this SimpleLoggable to the parent node.

If the name parameter is equal to "id", the loggable string representation is saved as an attribute of parent node instead.

Implements LogContentsPrinter.

Definition at line 210 of file XMLLogPrinter.h.

References XMLNode::AddAttribute(), Loggable::GetHumanReadableTypeName(), Loggable::GetStringValue(), and XMLContentsPrinter::m_xmlNodeStack.

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

- XMLLogPrinter.h