// 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 )
#define SG_HTTP_FILEREQUEST_HXX_
#include <simgear/misc/sg_path.hxx>
+
#include "HTTPRequest.hxx"
-#include <fstream>
+
+#include <simgear/misc/sgstream.hxx>
namespace simgear
{
protected:
SGPath _filename;
- std::ofstream _file;
+ sg_ofstream _file;
virtual void responseHeadersComplete();
virtual void gotBodyData(const char* s, int n);
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() )
{
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
/**
* Open a stream
- * @param name file name
+ * @param name file name, UTF-8 encoded
* @param io_mode mode flags
* @return file stream
*/