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 2001/02/13 23:45:44 UTC

cvs commit: xml-xalan/c/samples/StreamTransform StreamTransform.cpp

dbertoni    01/02/13 14:45:44

  Modified:    c/samples/StreamTransform StreamTransform.cpp
  Log:
  Fixed problems with build on HP-UX.
  
  Revision  Changes    Path
  1.4       +14 -5     xml-xalan/c/samples/StreamTransform/StreamTransform.cpp
  
  Index: StreamTransform.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/StreamTransform/StreamTransform.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StreamTransform.cpp	2001/01/08 20:26:31	1.3
  +++ StreamTransform.cpp	2001/02/13 22:45:43	1.4
  @@ -3,9 +3,15 @@
   
   
   
  +#if defined(XALAN_OLD_STREAM_HEADERS)
  +#include <iostream.h>
  +#include <strstream.h>
  +#include <fstream.h>
  +#else
   #include <iostream>
   #include <strstream>
   #include <fstream>
  +#endif
   
   
   
  @@ -13,6 +19,10 @@
   
   
   
  +#include <Include/XalanAutoPtr.hpp>
  +
  +
  +
   #include <PlatformSupport/DOMStringHelper.hpp>
   
   
  @@ -161,12 +171,11 @@
   				theOutputStream << '\0';
   
   #if !defined(SIMPLE_STREAM_USE_STATIC_BUFFER)
  -				// Get a pointer to the string...
  -				const char* const	theData = theOutputStream.str();
  +				// Get a pointer to the string, and store it in a XalanArrayAutoPtr,
  +				// since it will need to be deleted.
  +				const XalanArrayAutoPtr<char>	theGuard(theOutputStream.str());
   
  -				// Unfreeze the stream, so the memory is automatically
  -				// delete when the stream goes out of scope...
  -				theOutputStream.freeze(false);
  +				const char* const	theData = theGuard.get();
   #endif
   
   				cout << theData;