Mixes for Privacy and Anonymity in the Internet
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DOM_Output Class Reference

Static Public Member Functions

static SINT32 dumpToMem (const DOMNode *node, UINT8 *buff, UINT32 *size)
 Dumps the node and all childs into buff. More...
 
static UINT8dumpToMem (const DOMNode *node, UINT32 *size)
 Dumps the Node an returns a pointer to the memory. More...
 
static UINT8dumpToString (const DOMNode *node, bool a_bAddNewLine)
 Dumps the Node an returns a pointer to a null terminated string. More...
 
static SINT32 makeCanonical (const DOMNode *node, UINT8 *buff, UINT32 *size)
 Dumps the node and all childs in a 'cannonical form' into buff. More...
 
static UINT8makeCanonical (const DOMNode *node, UINT32 *size)
 Dumps the Node in a cannonical form and returns a pointer to the memory. More...
 

Private Member Functions

 DOM_Output ()
 
 ~DOM_Output ()
 
SINT32 dumpNode (const DOMNode *toWrite, bool bCanonical)
 Dumps a Node of an XML Document. More...
 

Static Private Member Functions

static UINT8dumpToMem (const DOMNode *node, UINT32 *size, OUTPUT_FORMAT a_outputFormat)
 Dumps the Node an returns a pointer to the memory. More...
 

Private Attributes

XMLFormatter * m_pFormatter
 
MemFormatTargetm_pFormatTarget
 

Static Private Attributes

static const XMLCh m_XML [41]
 
static const XMLCh m_UTF8 [6]
 
static const XMLCh m_1_0 [4]
 

Constructor & Destructor Documentation

◆ DOM_Output()

DOM_Output::DOM_Output ( )
private

◆ ~DOM_Output()

DOM_Output::~DOM_Output ( )
private

References m_pFormatTarget, and m_pFormatter.

Member Function Documentation

◆ dumpNode()

SINT32 DOM_Output::dumpNode ( const DOMNode *  toWrite,
bool  bCanonical 
)
private

Dumps a Node of an XML Document.

Parameters
toWriteNode which will be dumped
bCanonicalif true the dump is done in a 'canonical' way, e.g. white spaces are eliminated etc.
Return values
E_SUCCESSif successful
E_UNKNOWNotherwise

References E_SUCCESS, E_UNKNOWN, gEndElement, m_pFormatter, and m_XML.

Referenced by dumpToMem(), and makeCanonical().

◆ dumpToMem() [1/3]

static UINT8* DOM_Output::dumpToMem ( const DOMNode *  node,
UINT32 size 
)
static

Dumps the Node an returns a pointer to the memory.

Note that the string is NOT null-terminated.

Parameters
nodeNode to dump
sizeon return contains the number of XML-Chars copied
Returns
a pointer to a newls allocated buff, which must be delete[] by the caller
NULL if an error occurs

References dumpToMem(), and OF_DEFAULT.

◆ dumpToMem() [2/3]

static UINT8* DOM_Output::dumpToMem ( const DOMNode *  node,
UINT32 size,
OUTPUT_FORMAT  a_outputFormat 
)
staticprivate

Dumps the Node an returns a pointer to the memory.

Parameters
nodeNode to dump
sizeon return contains the number of XML-Chars copied
a_outputFormatthe output format of the string, e.g. with null termination
Returns
a pointer to a newls allocated buff, which must be delete[] by the caller
NULL if an error occurs

References MemFormatTarget::dumpMem(), dumpNode(), E_SUCCESS, and m_pFormatTarget.

◆ dumpToMem() [3/3]

static SINT32 DOM_Output::dumpToMem ( const DOMNode *  node,
UINT8 buff,
UINT32 size 
)
static

◆ dumpToString()

static UINT8* DOM_Output::dumpToString ( const DOMNode *  node,
bool  a_bAddNewLine 
)
static

Dumps the Node an returns a pointer to a null terminated string.

Parameters
nodeNode to dump
a_bAddNewLinetrue if a new line should be added to the end of the string; false otherwise
Returns
a pointer to a newls allocated buff, which must be delete[] by the caller
NULL if an error occurs

References dumpToMem(), OF_NEWLINE, and OF_NULL_TERMINATED.

Referenced by CAXMLErrorMessage::setValues().

◆ makeCanonical() [1/2]

static UINT8* DOM_Output::makeCanonical ( const DOMNode *  node,
UINT32 size 
)
static

Dumps the Node in a cannonical form and returns a pointer to the memory.

Parameters
nodeNode to dump
sizeon return contains the number of XML-Chars copied
Returns
a pointer to a newly allocated buff, which must be delete[] by the caller
NULL if an error occurs

References MemFormatTarget::dumpMem(), dumpNode(), E_SUCCESS, m_pFormatTarget, and OF_DEFAULT.

◆ makeCanonical() [2/2]

static SINT32 DOM_Output::makeCanonical ( const DOMNode *  node,
UINT8 buff,
UINT32 size 
)
static

Dumps the node and all childs in a 'cannonical form' into buff.

Parameters
nodeNode to dump
buffbuffer in which to copy the XML-chars
sizecontains the size of buff, on return contains the number of XML-CHars copied
Returns
E_SUCCESS if successful
E_SPACE if buff is to small
E_UNKNOWN if an error occurs

References MemFormatTarget::dumpMem(), dumpNode(), E_SUCCESS, E_UNKNOWN, and m_pFormatTarget.

Referenced by CAAccountingInstance::prepareCCRequest(), CAMultiSignature::signXML(), CAMultiSignature::verifyXML(), and CASignature::verifyXML().

Member Data Documentation

◆ m_1_0

const XMLCh DOM_Output::m_1_0
staticprivate
Initial value:
=
{
chDigit_1,chPeriod,chDigit_0, chNull
}

Referenced by DOM_Output().

◆ m_pFormatTarget

MemFormatTarget* DOM_Output::m_pFormatTarget
private

◆ m_pFormatter

XMLFormatter* DOM_Output::m_pFormatter
private

Referenced by DOM_Output(), dumpNode(), and ~DOM_Output().

◆ m_UTF8

const XMLCh DOM_Output::m_UTF8
staticprivate
Initial value:
=
{
chLatin_U, chLatin_T,chLatin_F, chDash,chDigit_8, chNull
}

Referenced by DOM_Output().

◆ m_XML

const XMLCh DOM_Output::m_XML
staticprivate
Initial value:
=
{
chOpenAngle,chQuestion,chLatin_x,chLatin_m,chLatin_l,chSpace,
chLatin_v,chLatin_e,chLatin_r,chLatin_s,chLatin_i,chLatin_o,chLatin_n,chEqual,
chDoubleQuote,chDigit_1,chPeriod,chDigit_0,chDoubleQuote,chSpace,
chLatin_e,chLatin_n,chLatin_c,chLatin_o,chLatin_d,chLatin_i,chLatin_n,chLatin_g,chEqual,
chDoubleQuote,chLatin_U, chLatin_T,chLatin_F, chDash,chDigit_8, chDoubleQuote,
chSpace,chQuestion, chCloseAngle, chLF, chNull
}

Referenced by dumpNode().