From f71920967baf7e7fdd77cab5480e3ceeb61eda38 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 3 Jul 2016 23:05:42 +0100 Subject: [PATCH] Fix sg_gzofstream path type (now SGPath) --- simgear/misc/sgstream.cxx | 7 ++++--- simgear/misc/sgstream.hxx | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/simgear/misc/sgstream.cxx b/simgear/misc/sgstream.cxx index 01e7ff12..41289a63 100644 --- a/simgear/misc/sgstream.cxx +++ b/simgear/misc/sgstream.cxx @@ -162,7 +162,7 @@ sg_gzofstream::sg_gzofstream() // // Open a file for gzipped writing. // -sg_gzofstream::sg_gzofstream( const std::string& name, ios_openmode io_mode ) +sg_gzofstream::sg_gzofstream( const SGPath& name, ios_openmode io_mode ) : ostream(&gzbuf) { this->open( name, io_mode ); @@ -183,9 +183,10 @@ sg_gzofstream::sg_gzofstream( int fd, ios_openmode io_mode ) // Open a file for gzipped writing. // void -sg_gzofstream::open( const std::string& name, ios_openmode io_mode ) +sg_gzofstream::open( const SGPath& name, ios_openmode io_mode ) { - gzbuf.open( name.c_str(), io_mode ); + std::string ps = name.local8BitStr(); + gzbuf.open( ps.c_str(), io_mode ); } void diff --git a/simgear/misc/sgstream.hxx b/simgear/misc/sgstream.hxx index f676b8a0..057c1d31 100644 --- a/simgear/misc/sgstream.hxx +++ b/simgear/misc/sgstream.hxx @@ -133,7 +133,7 @@ public: * @param name name of file * @param io_mode file open mode(s) "or'd" together */ - sg_gzofstream( const std::string& name, + sg_gzofstream( const SGPath& name, ios_openmode io_mode = ios_out | ios_binary ); /** @@ -148,7 +148,7 @@ public: * @param name name of file * @param io_mode file open mode(s) "or'd" together */ - void open( const std::string& name, + void open( const SGPath& name, ios_openmode io_mode = ios_out|ios_binary ); /** -- 2.39.5