xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Heinz" <AHe...@exstream.com>
Subject RE: XMLString::fixURI questions
Date Wed, 21 Apr 2004 13:02:16 GMT
2) I would use XMLPlatformUtils::fgArrayMemoryManager->allocate(...) to get your void*,
then cast to XMLCh*.  Xerces is consistent in its use of new[] and delete[] via this memory

Adam Heinz
Senior Software Developer
Exstream Software

-----Original Message-----
From: Nick Bastin [mailto:nbastin@opnet.com]
Sent: Monday, April 19, 2004 5:30 PM
To: xerces-c-dev@xml.apache.org
Subject: XMLString::fixURI questions

I have two questions related to the use of fixURI:

1) Why does fixURI take a buffer, rather than return you one - how are 
you supposed to know how big the resultant URI is going to be?  I would 
*presume* (although I could be wrong) that fixURI also escapes out 
invalid characters, which means that it's not enough to allocate a few 
extra characters for file:/// (which I see some people doing).  If it 
is just enough to add 9 bytes, then I don't imagine that it actually 
'fixes' the URI completely.

2) How do you allocate a raw XMLCh * to pass in?  Obviously I can just 
malloc() myself some memory, but that didn't seem like the right thing 
- this being C++ and all.  Even pulling that out of allocator seems 
like it should be a mistake, but maybe that's the usage pattern.

Along those lines, is there any reason that XMLCh is a character array, 
and not something like std::string?  It seems like we have C++, so 
using it to avoid having to pass around character buffers seems like a 
good idea.


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

View raw message