Details
Description
Xerces 2.x requires some methods to be implemented in XMLPlatformUtils that have
not been implemented for Unixware in UnixWarePlatformUtils.cpp in
$XERCESCROOT/src/xercesc/utils/UnixWare. These are writeBufferToFile() and
openFileToWrite(). The Linux versions of these are quite serviceable and can be
pasted in there as in this diff -e patch
343a
void
XMLPlatformUtils::writeBufferToFile( FileHandle const theFile
, long toWrite
, const XMLByte* const toFlush)
{
if (!theFile ||
(toWrite <= 0 ) ||
!toFlush )
return;
const XMLByte* tmpFlush = (const XMLByte*) toFlush;
size_t bytesWritten = 0;
while (true)
{
bytesWritten=fwrite(tmpFlush, sizeof(XMLByte), toWrite, (FILE*)theFile);
if(ferror((FILE*)theFile))
{ ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile); }if (bytesWritten < toWrite) //incomplete write
{ tmpFlush+=bytesWritten; toWrite-=bytesWritten; bytesWritten=0; } else
return;
}
return;
}
.
322a
FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName)
{
const char* tmpFileName = XMLString::transcode(fileName);
ArrayJanitor<char> janText((char*)tmpFileName);
return fopen( tmpFileName , "wb" );
}
FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName)
{
return fopen( fileName , "wb" );
}