You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Marcus Ackermann <Ma...@ptv.de> on 2002/04/24 08:49:31 UTC

null termination of DOMStrings

Hi,

the documentation of DOMString::rawBuffer() says that the returned buffer is
not always null terminated. This implies that the buffer has to be copied
and a null character has to be appended to that copy of the buffer for
further use.

I would like to skip this copying for performance reasons. What does "not
always null terminated" mean? In which cases is the buffer definitely null
terminated?

I only want to use this to obtain the value and name from a DOM_Node using
the functions DOM_Node::getNodeValue() and DOM_Node::getNodeName(). Is the
rawBuffer() of the thus obtained DOMString always null terminated? I tested
this with a simple application, and the result was that all rawBuffers were
null terminated.

Example

DOM_Node xmlNode;
[...]
XMLCh* pStr = xmlNode.getNodeName().rawBuffer()

For each node of the tested XML strings pStr was null terminated.

Thanks
Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org