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...@apache.org on 2002/08/13 07:20:39 UTC

cvs commit: xml-xalan/c/src/PlatformSupport StdBinInputStream.cpp StdBinInputStream.hpp

dbertoni    2002/08/12 22:20:39

  Modified:    c/src/PlatformSupport StdBinInputStream.cpp
                        StdBinInputStream.hpp
  Log:
  Use per-character input for std::cin.
  
  Revision  Changes    Path
  1.15      +29 -2     xml-xalan/c/src/PlatformSupport/StdBinInputStream.cpp
  
  Index: StdBinInputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/StdBinInputStream.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- StdBinInputStream.cpp	12 Aug 2002 04:19:25 -0000	1.14
  +++ StdBinInputStream.cpp	13 Aug 2002 05:20:39 -0000	1.15
  @@ -69,7 +69,7 @@
   #if defined(XALAN_OLD_STREAM_HEADERS)
   #include <iostream.h>
   #else
  -#include <istream>
  +#include <iostream>
   #endif
   #endif
   
  @@ -81,7 +81,12 @@
   StdBinInputStream::StdBinInputStream(std::istream&	theStream) :
   #endif
   	BinInputStream(),
  -	m_stream(theStream)
  +	m_stream(theStream),
  +#if defined(XALAN_NO_NAMESPACES)
  +	m_cin(&m_stream == &cin ? true : false)
  +#else
  +	m_cin(&m_stream == &std::cin ? true : false)
  +#endif
   {
   }
   
  @@ -111,6 +116,28 @@
   	if (!m_stream)
   	{
   		return 0;
  +	}
  +	else if (m_cin == true)
  +	{
  +		unsigned int	i = 0;
  +
  + 		while(i < maxToRead)
  + 		{
  + 			const int	ch = m_stream.get();
  + 
  + 			if (ch == EOF)
  + 			{
  + 				break;
  + 			}
  + 			else
  + 			{
  + 				toFill[i] = XMLByte(ch);
  + 
  + 				++i;
  + 			}
  + 		}
  + 
  + 		return i;
   	}
   	else
   	{
  
  
  
  1.6       +2 -0      xml-xalan/c/src/PlatformSupport/StdBinInputStream.hpp
  
  Index: StdBinInputStream.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/StdBinInputStream.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StdBinInputStream.hpp	23 Feb 2002 04:17:46 -0000	1.5
  +++ StdBinInputStream.hpp	13 Aug 2002 05:20:39 -0000	1.6
  @@ -119,6 +119,8 @@
   #else
   	std::istream&	m_stream;
   #endif
  +
  +	const bool		m_cin;
   };
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org