You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/04/25 21:49:00 UTC

cvs commit: xml-xalan/c/src/XercesPlatformSupport NullTextOutputStream.cpp NullTextOutputStream.hpp XercesDOMPrintWriter.cpp XercesDOMPrintWriter.hpp XercesTextOutputStream.cpp XercesTextOutputStream.hpp

dbertoni    00/04/25 12:49:00

  Modified:    c/src/XercesPlatformSupport NullTextOutputStream.cpp
                        NullTextOutputStream.hpp XercesDOMPrintWriter.cpp
                        XercesDOMPrintWriter.hpp XercesTextOutputStream.cpp
                        XercesTextOutputStream.hpp
  Log:
  Changes for Xerces class that disappeared.
  
  Revision  Changes    Path
  1.2       +34 -2     xml-xalan/c/src/XercesPlatformSupport/NullTextOutputStream.cpp
  
  Index: NullTextOutputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/NullTextOutputStream.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullTextOutputStream.cpp	1999/12/18 19:48:15	1.1
  +++ NullTextOutputStream.cpp	2000/04/25 19:48:53	1.2
  @@ -80,13 +80,45 @@
   
   
   void
  -NullTextOutputStream::write(const XMLCh* const	/* theBuffer */)
  +NullTextOutputStream::write(char	/* theChar */)
   {
   }
   
   
   
   void
  -NullTextOutputStream::write(const char* const	/* theBuffer */)
  +NullTextOutputStream::write(XalanDOMChar	/* theChar */)
  +{
  +}
  +
  +
  +
  +void
  +NullTextOutputStream::write(const XalanDOMChar*		/* theBuffer */)
  +{
  +}
  +
  +
  +
  +void
  +NullTextOutputStream::write(const char*		/* theBuffer */)
  +{
  +}
  +
  +
  +
  +void
  +NullTextOutputStream::write(
  +			const char*		/* theBuffer */,
  +			unsigned long	/* theBufferLength */)
  +{
  +}
  +
  +
  +
  +void
  +NullTextOutputStream::write(
  +			const XalanDOMChar*		/* theBuffer */,
  +			unsigned long			/* theBufferLength */)
   {
   }
  
  
  
  1.2       +19 -3     xml-xalan/c/src/XercesPlatformSupport/NullTextOutputStream.hpp
  
  Index: NullTextOutputStream.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/NullTextOutputStream.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullTextOutputStream.hpp	1999/12/18 19:48:15	1.1
  +++ NullTextOutputStream.hpp	2000/04/25 19:48:54	1.2
  @@ -65,7 +65,7 @@
   
   
   // Base class header file.
  -#include <util/TextOutputStream.hpp>
  +#include <PlatformSupport/TextOutputStream.hpp>
   
   
   
  @@ -84,10 +84,26 @@
   	flush();
   
       virtual void
  -	write(const XMLCh* const	theBuffer);
  +	write(char	theChar);
   
       virtual void
  -	write(const char* const		theBuffer);
  +	write(XalanDOMChar	theChar);
  +
  +    virtual void
  +	write(const XalanDOMChar*	theBuffer);
  +
  +    virtual void
  +	write(const char*	theBuffer);
  +
  +    virtual void
  +	write(
  +			const char*		theBuffer,
  +			unsigned long	theBufferLength);
  +
  +    virtual void
  +	write(
  +			const XalanDOMChar*		theBuffer,
  +			unsigned long			theBufferLength);
   
   private:
   
  
  
  
  1.4       +14 -10    xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.cpp
  
  Index: XercesDOMPrintWriter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XercesDOMPrintWriter.cpp	2000/02/17 20:28:07	1.3
  +++ XercesDOMPrintWriter.cpp	2000/04/25 19:48:54	1.4
  @@ -63,12 +63,12 @@
   
   
   
  -#include <util/TextOutputStream.hpp>
   #include <dom/DOMString.hpp>
   
   
   
   #include <PlatformSupport/DOMStringHelper.hpp>
  +#include <PlatformSupport/TextOutputStream.hpp>
   
   
   
  @@ -135,11 +135,11 @@
   	{
   		if (theOffset == 0)
   		{
  -			m_OutputStream << s;
  +			m_OutputStream.write(s);
   		}
   		else
   		{
  -			m_OutputStream << s + theOffset;
  +			m_OutputStream.write(s + theOffset);
   		}
   	}
   	else
  @@ -148,7 +148,7 @@
   
   		for (long i = theOffset; i < theStopIndex; i++)
   		{
  -			m_OutputStream << s[i];
  +			m_OutputStream.write(s[i]);
   		}
   	}
   }
  @@ -158,7 +158,7 @@
   void
   XercesDOMPrintWriter::write(XMLCh	c)
   {
  -	m_OutputStream << c;
  +	m_OutputStream.write(c);
   }
   
   
  @@ -173,6 +173,9 @@
   	assert(theLength >= 0 || theLength == -1);
   	assert(theLength == -1 && length(s) > theOffset || length(s) >= theOffset + theLength);
   
  +#if 1
  +	write(c_wstr(s), theOffset, theLength);
  +#else
   	if (theOffset == 0 && theLength == -1)
   	{
   		m_OutputStream << s;
  @@ -187,6 +190,7 @@
   			m_OutputStream << s.charAt(i);
   		}
   	}
  +#endif
   }
   
   
  @@ -244,7 +248,7 @@
   void
   XercesDOMPrintWriter::print(double	d)
   {
  -	m_OutputStream << d;
  +	m_OutputStream.write(c_wstr(DoubleToDOMString(d)));
   }
   
   
  @@ -252,7 +256,7 @@
   void
   XercesDOMPrintWriter::print(int	i)
   {
  -	m_OutputStream << static_cast<long>(i);
  +	m_OutputStream.write(c_wstr(LongToDOMString(i)));
   }
   
   
  @@ -260,7 +264,7 @@
   void
   XercesDOMPrintWriter::print(long	l)
   {
  -	m_OutputStream << l;
  +	m_OutputStream.write(c_wstr(LongToDOMString(l)));
   }
   
   
  @@ -268,7 +272,7 @@
   void
   XercesDOMPrintWriter::print(const DOMString&	s)
   {
  -	m_OutputStream << s;
  +	m_OutputStream.write(c_wstr(s));
   }
   
   
  @@ -276,7 +280,7 @@
   void
   XercesDOMPrintWriter::println()
   {
  -	m_OutputStream << TextOutputStream::EndLine;	
  +	m_OutputStream.write("\n");
   }
   
   
  
  
  
  1.4       +1 -1      xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.hpp
  
  Index: XercesDOMPrintWriter.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesDOMPrintWriter.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XercesDOMPrintWriter.hpp	2000/03/06 20:23:14	1.3
  +++ XercesDOMPrintWriter.hpp	2000/04/25 19:48:54	1.4
  @@ -84,7 +84,7 @@
   	 */
   	XercesDOMPrintWriter(
   			TextOutputStream&	theOutputStream,
  -			bool	fAutoFlush = false);
  +			bool				fAutoFlush = false);
   
   	virtual
   	~XercesDOMPrintWriter();
  
  
  
  1.3       +40 -29    xml-xalan/c/src/XercesPlatformSupport/XercesTextOutputStream.cpp
  
  Index: XercesTextOutputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesTextOutputStream.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesTextOutputStream.cpp	2000/02/03 20:13:27	1.2
  +++ XercesTextOutputStream.cpp	2000/04/25 19:48:55	1.3
  @@ -59,33 +59,20 @@
   
   
   
  -
  -
  -#if defined(_MSC_VER)
  -#include "windows.h"
  -#else
  -#define INVALID_HANDLE_VALUE 0
  -#endif
  -
  -
  -
  -#include <util/Janitor.hpp>
   #include <util/XMLString.hpp>
   
   
   
   #include <PlatformSupport/DOMStringHelper.hpp>
  +#include <PlatformSupport/STLHelper.hpp>
   
   
   
  -
  -
   const XercesTextOutputStream::BufferType::size_type	XercesTextOutputStream::s_bufferSize = 8192;
   
   
   
  -XercesTextOutputStream::XercesTextOutputStream() :
  -	TextOutputStream()
  +XercesTextOutputStream::XercesTextOutputStream()
   {
   }
   
  @@ -108,19 +95,34 @@
   
   
   void
  -XercesTextOutputStream::write(const XMLCh* const	theBuffer)
  +XercesTextOutputStream::write(char	theChar)
   {
  -	assert(theBuffer != 0);
  +	write(&theChar, 1);
  +}
  +
  +
  +
  +void
  +XercesTextOutputStream::write(XalanDOMChar	theChar)
  +{
  +	write(&theChar, 1);
  +}
   
  -	const BufferType::size_type		theLength =
  -		static_cast<BufferType::size_type>(length(theBuffer));
   
  -	if (theLength + m_buffer.size() > s_bufferSize)
  +
  +void
  +XercesTextOutputStream::write(
  +			const XalanDOMChar*		theBuffer,
  +			unsigned long			theBufferLength)
  +{
  +	assert(theBuffer != 0);
  +
  +	if (theBufferLength + m_buffer.size() > s_bufferSize)
   	{
   		flushBuffer();
   	}
   
  -	if (theLength > s_bufferSize)
  +	if (theBufferLength > s_bufferSize)
   	{
   		doWrite(theBuffer);
   	}
  @@ -128,15 +130,26 @@
   	{
   		m_buffer.insert(m_buffer.end(),
   						theBuffer,
  -						theBuffer + theLength);
  +						theBuffer + theBufferLength);
   	}
   }
   
   
   
   void
  -XercesTextOutputStream::write(const char* const	theBuffer)
  +XercesTextOutputStream::write(const XalanDOMChar*	theBuffer)
   {
  +	if (theBuffer != 0)
  +	{
  +		write(theBuffer, length(theBuffer));
  +	}
  +}
  +
  +
  +
  +void
  +XercesTextOutputStream::write(const char*	theBuffer)
  +{
   	assert(theBuffer != 0);
   
   	flushBuffer();
  @@ -178,16 +191,14 @@
   
   
   void
  -XercesTextOutputStream::doWrite(const XMLCh*	theBuffer)
  +XercesTextOutputStream::doWrite(const XalanDOMChar*		theBuffer)
   {
   	assert(theBuffer != 0);
  -
  -    char* const	tmpVal = XMLString::transcode(theBuffer);
   
  -    ArrayJanitor<char> janTmp(tmpVal);
  +    array_auto_ptr<char>	theTranscodedString(XMLString::transcode(theBuffer));
   
  -	writeData(tmpVal,
  -			  strlen(tmpVal));
  +	writeData(theTranscodedString.get(),
  +			  strlen(theTranscodedString.get()));
   }
   
   
  
  
  
  1.3       +20 -16    xml-xalan/c/src/XercesPlatformSupport/XercesTextOutputStream.hpp
  
  Index: XercesTextOutputStream.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesTextOutputStream.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesTextOutputStream.hpp	2000/03/06 20:23:15	1.2
  +++ XercesTextOutputStream.hpp	2000/04/25 19:48:56	1.3
  @@ -63,15 +63,17 @@
   #include <XercesPlatformSupport/XercesPlatformSupportDefinitions.hpp>
   
   
  -#if !defined(_MSC_VER)
  +
   #include <cstdio>
  -#endif
   #include <vector>
   
   
   
   // Base class header file.
  -#include <util/TextOutputStream.hpp>
  +#include <PlatformSupport/TextOutputStream.hpp>
  +
  +
  +
   #include <XercesPlatformSupport/XercesPlatformSupportException.hpp>
   
   
  @@ -83,32 +85,34 @@
   
       virtual
   	~XercesTextOutputStream();
  -
   
  -    // These are inherited from TextOutputStream...
  +	// These interfaces are inherited from TextOutputStream...
   
       virtual void
   	flush();
   
       virtual void
  -	write(const XMLCh* const	theBuffer);
  +	write(char	theChar);
   
       virtual void
  -	write(const char* const		theBuffer);
  +	write(XalanDOMChar	theChar);
   
  -    // This is new...
  +    virtual void
  +	write(const char*	theBuffer);
   
  -	/**
  -	 * Write a specified number of characters to the output stream.
  -	 *
  -	 * @param theBuffer       character buffer to write from
  -	 * @param theBufferLength number of characters to write
  -	 */
       virtual void
  +	write(const XalanDOMChar*	theBuffer);
  +
  +    virtual void
   	write(
   			const char*		theBuffer,
   			unsigned long	theBufferLength);
   
  +    virtual void
  +	write(
  +			const XalanDOMChar*		theBuffer,
  +			unsigned long			theBufferLength);
  +
   protected:
   
   	explicit
  @@ -134,10 +138,10 @@
   	flushBuffer();
   
   	void
  -	doWrite(const XMLCh*	theBuffer);
  +	doWrite(const XalanDOMChar*		theBuffer);
   
   	// Data members...
  -	typedef std::vector<XMLCh>	BufferType;
  +	typedef std::vector<XalanDOMChar>	BufferType;
   
   	BufferType							m_buffer;