|
Mixe for Privacy and Anonymity in the Internet
|
Abstract base class for classes which can be converted to an XML structure. More...
#include <CAAbstractXMLEncodable.hpp>
Public Member Functions | |
| CAAbstractXMLEncodable () | |
| virtual | ~CAAbstractXMLEncodable () |
| pure virtual destructor. | |
| 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. | |
| SINT32 | toXmlDocument (XERCES_CPP_NAMESPACE::DOMDocument *&pDoc) |
| returns a pointer to the tagname of this XML structure's top level element. | |
| UINT8 * | toXmlString (UINT32 *pSize) |
| Converts the XML structure to a null-terminated C-String representation. | |
Abstract base class for classes which can be converted to an XML structure.
This corresponds to anon.util.IXMLEncodable in the Java implementation
Definition at line 41 of file CAAbstractXMLEncodable.hpp.
| CAAbstractXMLEncodable::CAAbstractXMLEncodable | ( | ) | [inline] |
Definition at line 43 of file CAAbstractXMLEncodable.hpp.
{
}
| virtual CAAbstractXMLEncodable::~CAAbstractXMLEncodable | ( | ) | [inline, virtual] |
pure virtual destructor.
Define real destructor in your derived class
Definition at line 48 of file CAAbstractXMLEncodable.hpp.
{
}
| 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.
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().
{
DOMElement* pElemRoot=NULL;
pDoc = createDOMDocument();
toXmlElement(pDoc, pElemRoot);
pDoc->appendChild(pElemRoot);
return E_SUCCESS;
}
| 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.
| a_doc | an existing DOM_Document |
| elemRoot | on 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, CAXMLBI, and CAXMLPriceCert.
Referenced by toXmlDocument(), and CAXMLErrorMessage::toXmlElement().
| UINT8 * CAAbstractXMLEncodable::toXmlString | ( | UINT32 * | pSize | ) |
Converts the XML structure to a null-terminated C-String representation.
| size | on return contains the size of the allocated buffer |
Definition at line 42 of file CAAbstractXMLEncodable.cpp.
References DOM_Output::dumpToMem(), and toXmlDocument().
{
XERCES_CPP_NAMESPACE::DOMDocument* pDoc=NULL;
toXmlDocument(pDoc);
UINT8* tmp = DOM_Output::dumpToMem(pDoc, pSize);
// put null at the end...
UINT8* tmp2 = new UINT8[*pSize+1];
memcpy(tmp2, tmp, *pSize);
tmp2[*pSize]=0;
delete[] tmp;
tmp = NULL;
if (pDoc != NULL)
{
pDoc->release();
pDoc = NULL;
}
//delete pDoc;
return tmp2;
}
1.7.6.1