From: James Turner Date: Fri, 15 Jul 2016 15:33:52 +0000 (+0100) Subject: Further SGPath API usage cleanups. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=721902e468a8d49b85e08cf1fac296abf8931ff5;p=simgear.git Further SGPath API usage cleanups. --- diff --git a/simgear/io/HTTPFileRequest.cxx b/simgear/io/HTTPFileRequest.cxx index 2a6d226f..fbd6035a 100644 --- a/simgear/io/HTTPFileRequest.cxx +++ b/simgear/io/HTTPFileRequest.cxx @@ -47,7 +47,7 @@ namespace HTTP // simgear) _filename.create_dir(0755); - _file.open(_filename.c_str(), std::ios::binary | std::ios::trunc | std::ios::out); + _file.open(_filename, std::ios::binary | std::ios::trunc | std::ios::out); } if( !_file ) diff --git a/simgear/io/HTTPFileRequest.hxx b/simgear/io/HTTPFileRequest.hxx index 9eaf7279..32b64811 100644 --- a/simgear/io/HTTPFileRequest.hxx +++ b/simgear/io/HTTPFileRequest.hxx @@ -20,8 +20,10 @@ #define SG_HTTP_FILEREQUEST_HXX_ #include + #include "HTTPRequest.hxx" -#include + +#include namespace simgear { @@ -45,7 +47,7 @@ namespace HTTP protected: SGPath _filename; - std::ofstream _file; + sg_ofstream _file; virtual void responseHeadersComplete(); virtual void gotBodyData(const char* s, int n); diff --git a/simgear/misc/sgstream.cxx b/simgear/misc/sgstream.cxx index 8f289c40..46d3eca7 100644 --- a/simgear/misc/sgstream.cxx +++ b/simgear/misc/sgstream.cxx @@ -68,8 +68,7 @@ sg_gzifstream::sg_gzifstream( int fd, ios_openmode io_mode ) void sg_gzifstream::open( const SGPath& name, ios_openmode io_mode ) { - std::string s = name.local8BitStr(); - + std::string s = name.utf8Str(); gzbuf.open( s.c_str(), io_mode ); if ( ! gzbuf.is_open() ) { @@ -185,7 +184,8 @@ sg_gzofstream::sg_gzofstream( int fd, ios_openmode io_mode ) void sg_gzofstream::open( const SGPath& name, ios_openmode io_mode ) { - gzbuf.open( name.c_str(), io_mode ); + std::string s = name.utf8Str(); + gzbuf.open( s.c_str(), io_mode ); } void diff --git a/simgear/misc/zfstream.hxx b/simgear/misc/zfstream.hxx index 004340d3..6500b8c5 100644 --- a/simgear/misc/zfstream.hxx +++ b/simgear/misc/zfstream.hxx @@ -66,7 +66,7 @@ public: /** * Open a stream - * @param name file name + * @param name file name, UTF-8 encoded * @param io_mode mode flags * @return file stream */