Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-832

Unixware platform utils not implemented

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • Utilities
    • None
    • Operating System: Other
      Platform: Other
    • 17774

    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" );
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            pjc@kerridge.com Peter Crozier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: