You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/01/18 20:55:38 UTC

cvs commit: xml-xerces/c/src/dom DOMString.cpp

andyh       00/01/18 11:55:38

  Modified:    c/src/dom DOMString.cpp
  Log:
  Remove dependencies on XMLStdout and err, as these are about
  to stop working.
  
  Revision  Changes    Path
  1.7       +18 -7     xml-xerces/c/src/dom/DOMString.cpp
  
  Index: DOMString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DOMString.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMString.cpp	2000/01/05 22:16:26	1.6
  +++ DOMString.cpp	2000/01/18 19:55:37	1.7
  @@ -56,6 +56,10 @@
   
   /**
    * $Log: DOMString.cpp,v $
  + * Revision 1.7  2000/01/18 19:55:37  andyh
  + * Remove dependencies on XMLStdout and err, as these are about
  + * to stop working.
  + *
    * Revision 1.6  2000/01/05 22:16:26  robweir
    * Move DOMString implementation class declarations into a new
    * file: DOMStringImpl.hpp.  Include this header in DOMString.hpp
  @@ -89,12 +93,12 @@
    * Swat for adding in Product name and CVS comment log variable.
    *
    */
  -
   
  +#include <stdio.h>
   #include <util/PlatformUtils.hpp>
   #include <util/RuntimeException.hpp>
  -#include <util/StdOut.hpp>
   #include <util/TransService.hpp>
  +#include <util/XMLString.hpp>
   #include "DOMString.hpp"
   
   #ifndef XML_DEBUG
  @@ -763,26 +767,31 @@
   
       if (len > 0)
       {
  -
           XMLCh *p = fHandle->fDSData->fData;
   
  -		XMLStdOut out;
  +        // Copy the data from the DOMString buffer into another buffer.
  +        //  This is only required because the data in the DOMString buffer
  +        //  may not be null terminated, but we need the null here.
   		XMLCh* buffer = new XMLCh[len+1];
           int i;
   		for (i=0; i<len; i++)
   		   buffer[i] = p[i];
   		buffer[len] = 0;
  -		out << buffer;
  +
  +        // Transcode from Unicode to char * in whatever the system local code page is.
  +        char *pc = XMLString::transcode(buffer);
  +        fputs(pc, stdout);
  +
           delete [] buffer;
  +        delete pc;
       };
   };
   
   
   void DOMString::println() const
   {
  -    XMLStdOut out;
   	print();
  -    out << EndLn;
  +    putchar('\n');
   };