Further SGPath API usage cleanups.

This commit is contained in:
James Turner
2016-07-15 16:33:52 +01:00
parent 19df18fefb
commit 31ba9dfa70
4 changed files with 9 additions and 7 deletions

View File

@@ -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 )

View File

@@ -20,8 +20,10 @@
#define SG_HTTP_FILEREQUEST_HXX_
#include <simgear/misc/sg_path.hxx>
#include "HTTPRequest.hxx"
#include <fstream>
#include <simgear/misc/sgstream.hxx>
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);

View File

@@ -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

View File

@@ -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
*/