Mixe for Privacy and Anonymity in the Internet
Public Member Functions | List of all members
CAAbstractXMLEncodable Class Referenceabstract

Abstract base class for classes which can be converted to an XML structure. More...

#include <CAAbstractXMLEncodable.hpp>

Inheritance diagram for CAAbstractXMLEncodable:
Collaboration diagram for CAAbstractXMLEncodable:

Public Member Functions

 CAAbstractXMLEncodable ()
 
virtual ~CAAbstractXMLEncodable ()
 pure virtual destructor. More...
 
virtual SINT32 toXmlElement (XERCES_CPP_NAMESPACE::DOMDocument *a_pDoc, DOMElement *&pElemRoot)=0
 Creates the XML structure inside an existing DOM_Document, but does not append it to any node. More...
 
SINT32 toXmlDocument (XERCES_CPP_NAMESPACE::DOMDocument *&pDoc)
 returns a pointer to the tagname of this XML structure's top level element. More...
 
UINT8toXmlString (UINT32 *pSize)
 Converts the XML structure to a null-terminated C-String representation. More...
 

Detailed Description

Abstract base class for classes which can be converted to an XML structure.

This corresponds to anon.util.IXMLEncodable in the Java implementation

Author
Bastian Voigt

Definition at line 41 of file CAAbstractXMLEncodable.hpp.

Constructor & Destructor Documentation

◆ CAAbstractXMLEncodable()

CAAbstractXMLEncodable::CAAbstractXMLEncodable ( )
inline

Definition at line 43 of file CAAbstractXMLEncodable.hpp.

44  {
45  }

◆ ~CAAbstractXMLEncodable()

virtual CAAbstractXMLEncodable::~CAAbstractXMLEncodable ( )
inlinevirtual

pure virtual destructor.

Define real destructor in your derived class

Definition at line 48 of file CAAbstractXMLEncodable.hpp.

49  {
50  }

Member Function Documentation

◆ toXmlDocument()

SINT32 CAAbstractXMLEncodable::toXmlDocument ( XERCES_CPP_NAMESPACE::DOMDocument *&  pDoc)

returns a pointer to the tagname of this XML structure's top level element.

The buffer is allocated dynamically, the caller must delete[] it !! This is commented out because virtual static functions are not allowed, but should be implemented by subclasses nevertheless.. Creates a new XML document, then calls toXmlElement and appends the element as DocumentElement.

Definition at line 33 of file CAAbstractXMLEncodable.cpp.

34  {
35  DOMElement* pElemRoot=NULL;
36  pDoc = createDOMDocument();
37  toXmlElement(pDoc, pElemRoot);
38  pDoc->appendChild(pElemRoot);
39  return E_SUCCESS;
40  }
XERCES_CPP_NAMESPACE::DOMDocument * createDOMDocument()
Parses a timestamp in JDBC timestamp escape format (as it comes from the BI) and outputs the value in...
Definition: CAUtil.cpp:1568
virtual SINT32 toXmlElement(XERCES_CPP_NAMESPACE::DOMDocument *a_pDoc, DOMElement *&pElemRoot)=0
Creates the XML structure inside an existing DOM_Document, but does not append it to any node.
const SINT32 E_SUCCESS
Definition: errorcodes.hpp:2

References createDOMDocument(), E_SUCCESS, and toXmlElement().

Referenced by CAAccountingInstance::finishLoginProcess(), CAAccountingInstance::handleAccountCertificate_internal(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleCostConfirmation_internal(), CAAccountingInstance::processJapMessageLoginHelper(), CAAccountingInstance::returnPrepareKickout(), and toXmlString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toXmlElement()

virtual SINT32 CAAbstractXMLEncodable::toXmlElement ( XERCES_CPP_NAMESPACE::DOMDocument *  a_pDoc,
DOMElement *&  pElemRoot 
)
pure virtual

Creates the XML structure inside an existing DOM_Document, but does not append it to any node.

Parameters
a_docan existing DOM_Document
elemRooton return contains the root element of the created XML structure. Note that the element is not appended to any node in the document

Implemented in CAXMLErrorMessage.

Referenced by toXmlDocument(), and CAXMLErrorMessage::toXmlElement().

Here is the caller graph for this function:

◆ toXmlString()

UINT8 * CAAbstractXMLEncodable::toXmlString ( UINT32 pSize)

Converts the XML structure to a null-terminated C-String representation.

Parameters
sizeon return contains the size of the allocated buffer
Returns
a newly allocated buffer which must be delete[] by the caller

Definition at line 42 of file CAAbstractXMLEncodable.cpp.

43  {
44  XERCES_CPP_NAMESPACE::DOMDocument* pDoc=NULL;
45  toXmlDocument(pDoc);
46  UINT8* tmp = DOM_Output::dumpToMem(pDoc, pSize);
47  // put null at the end...
48  UINT8* tmp2 = new UINT8[*pSize+1];
49  memcpy(tmp2, tmp, *pSize);
50  tmp2[*pSize]=0;
51  delete[] tmp;
52  tmp = NULL;
53  if (pDoc != NULL)
54  {
55  pDoc->release();
56  pDoc = NULL;
57  }
58  //delete pDoc;
59  return tmp2;
60  }
unsigned char UINT8
Definition: basetypedefs.h:135
SINT32 toXmlDocument(XERCES_CPP_NAMESPACE::DOMDocument *&pDoc)
returns a pointer to the tagname of this XML structure's top level element.
static SINT32 dumpToMem(const DOMNode *node, UINT8 *buff, UINT32 *size)
Dumps the node and all childs into buff.
Definition: DOM_Output.hpp:161

References DOM_Output::dumpToMem(), and toXmlDocument().

Here is the call graph for this function:

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