Author: amassari
Date: Sun Oct 15 23:29:51 2006
New Revision: 464394
URL: http://svn.apache.org/viewvc?view=rev&rev=464394
Log:
Allow the user to specify the memory manager used by LSSerializer::writeToString
Modified:
xerces/c/trunk/doc/html/ApacheDOMC++BindingL3.html
xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp
xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp
Modified: xerces/c/trunk/doc/html/ApacheDOMC++BindingL3.html
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/doc/html/ApacheDOMC%2B%2BBindingL3.html?view=diff&rev=464394&r1=464393&r2=464394
==============================================================================
--- xerces/c/trunk/doc/html/ApacheDOMC++BindingL3.html (original)
+++ xerces/c/trunk/doc/html/ApacheDOMC++BindingL3.html Sun Oct 15 23:29:51 2006
@@ -4631,7 +4631,7 @@
<td><font face="Courier New,Courier"><font size=-1>XMLCh*</font></font></td>
-<td><font face="Courier New,Courier"><font size=-1>writeToString(const
DOMNode* nodeToWrite) = 0;</font></font></td>
+<td><font face="Courier New,Courier"><font size=-1>writeToString(const
DOMNode* nodeToWrite, MemoryManager* manager = NULL) = 0;</font></font></td>
</tr>
<tr ALIGN=LEFT VALIGN=TOP>
Modified: xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp?view=diff&rev=464394&r1=464393&r2=464394
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp Sun Oct 15 23:29:51 2006
@@ -506,13 +506,16 @@
* diagnostic purposes.
*
* @param nodeToWrite The node to be written.
+ * @param manager The memory manager to be used to allocate the result
string.
+ * If NULL is used, the memory manager used to construct the serializer
will
+ * be used.
* @return Returns the serialized data, or <code>null</code> in case a
* failure occured and the failure wasn't canceled by the error
* handler. The returned string is always in UTF-16.
* The encoding information available in DOMLSSerializer is ignored in
writeToString().
* @since DOM Level 3
*/
- virtual XMLCh* writeToString(const DOMNode* nodeToWrite) = 0;
+ virtual XMLCh* writeToString(const DOMNode* nodeToWrite,
MemoryManager* manager = NULL) = 0;
//@}
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp?view=diff&rev=464394&r1=464393&r2=464394
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp Sun Oct 15
23:29:51 2006
@@ -561,16 +561,18 @@
// We don't throw DOMSTRING_SIZE_ERR since we are no longer
// using DOMString.
//
-XMLCh* DOMLSSerializerImpl::writeToString(const DOMNode* nodeToWrite)
+XMLCh* DOMLSSerializerImpl::writeToString(const DOMNode* nodeToWrite,
MemoryManager* manager /*= NULL*/)
{
- MemBufFormatTarget destination(1023, fMemoryManager);
+ if(manager==NULL)
+ manager = fMemoryManager;
+ MemBufFormatTarget destination(1023, manager);
bool retVal;
bool bBOMFlag=getFeature(BYTE_ORDER_MARK_ID);
setFeature(BYTE_ORDER_MARK_ID, false);
try
{
- DOMLSOutputImpl output(fMemoryManager);
+ DOMLSOutputImpl output(manager);
output.setByteStream(&destination);
output.setEncoding(XMLUni::fgUTF16EncodingString);
retVal = write(nodeToWrite, &output);
@@ -590,7 +592,7 @@
}
setFeature(BYTE_ORDER_MARK_ID, bBOMFlag);
- return (retVal ? XMLString::replicate((XMLCh*) destination.getRawBuffer(),
fMemoryManager) : 0);
+ return (retVal ? XMLString::replicate((XMLCh*) destination.getRawBuffer(),
manager) : 0);
}
//
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp?view=diff&rev=464394&r1=464393&r2=464394
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp Sun Oct 15
23:29:51 2006
@@ -72,7 +72,7 @@
/**
* The caller is responsible for the release of the returned string
*/
- virtual XMLCh* writeToString(const DOMNode* nodeToWrite);
+ virtual XMLCh* writeToString(const DOMNode* nodeToWrite,
MemoryManager* manager = NULL);
virtual void release();
//@}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]