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

List of all members.

Static Public Member Functions

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

Private Member Functions

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

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.

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 ( ) [private]
DOM_Output::~DOM_Output ( ) [private]

References m_pFormatTarget, and m_pFormatter.


Member Function Documentation

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().

static SINT32 DOM_Output::dumpToMem ( const DOMNode *  node,
UINT8 buff,
UINT32 size 
) [static]
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.

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

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.

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().

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().

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.


Member Data Documentation

const XMLCh DOM_Output::m_1_0 [static, private]
Initial value:
  {
    chDigit_1,chPeriod,chDigit_0, chNull
  }

Referenced by DOM_Output().

XMLFormatter* DOM_Output::m_pFormatter [private]

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

const XMLCh DOM_Output::m_UTF8 [static, private]
Initial value:
  {
    chLatin_U, chLatin_T,chLatin_F, chDash,chDigit_8, chNull
  }

Referenced by DOM_Output().

const XMLCh DOM_Output::m_XML [static, private]
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, 
    chQuestion,chCloseAngle,chCR,chLF,chNull
}

Referenced by dumpNode().