]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/sgstream.cxx
hla: Use HLADataElementIndices for HLAInteractionClass.
[simgear.git] / simgear / misc / sgstream.cxx
index ec758afbcf7798f4967bf4ee38a88b41dd32e857..70da33afd1316052ebc9925a699a9fb4946392f6 100644 (file)
 // $Id$
 
 #include <simgear/compiler.h>
-#include STL_STRING 
-
+#include <string>
 #include <ctype.h> // isspace()
-
-#ifdef SG_HAVE_STD_INCLUDES
-# include <cerrno>
-#else
-# include <errno.h>
-#endif
+#include <cerrno>
 
 #include "sgstream.hxx"
 
 using std::string;
 using std::istream;
+using std::ostream;
 
 sg_gzifstream::sg_gzifstream()
     : istream(&gzbuf)
@@ -152,3 +147,44 @@ skipcomment( istream& in )
     return in;
 }
 
+
+sg_gzofstream::sg_gzofstream()
+    : ostream(&gzbuf)
+{
+}
+
+//-----------------------------------------------------------------------------
+//
+// Open a file for gzipped writing.
+//
+sg_gzofstream::sg_gzofstream( const string& name, ios_openmode io_mode )
+    : ostream(&gzbuf)
+{
+    this->open( name, io_mode );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Attach a stream to an already opened file descriptor.
+//
+sg_gzofstream::sg_gzofstream( int fd, ios_openmode io_mode )
+    : ostream(&gzbuf)
+{
+    gzbuf.attach( fd, io_mode );
+}
+
+//-----------------------------------------------------------------------------
+//
+// Open a file for gzipped writing.
+//
+void
+sg_gzofstream::open( const string& name, ios_openmode io_mode )
+{
+    gzbuf.open( name.c_str(), io_mode );
+}
+
+void
+sg_gzofstream::attach( int fd, ios_openmode io_mode )
+{
+    gzbuf.attach( fd, io_mode );
+}