Fix sg_gzofstream path type (now SGPath)

This commit is contained in:
James Turner 2016-07-03 23:05:42 +01:00
parent c037a0e461
commit ca84d2046a
2 changed files with 6 additions and 5 deletions

View File

@ -162,7 +162,7 @@ sg_gzofstream::sg_gzofstream()
// //
// Open a file for gzipped writing. // 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) : ostream(&gzbuf)
{ {
this->open( name, io_mode ); 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. // Open a file for gzipped writing.
// //
void 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 void

View File

@ -133,7 +133,7 @@ public:
* @param name name of file * @param name name of file
* @param io_mode file open mode(s) "or'd" together * @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 ); ios_openmode io_mode = ios_out | ios_binary );
/** /**
@ -148,7 +148,7 @@ public:
* @param name name of file * @param name name of file
* @param io_mode file open mode(s) "or'd" together * @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 ); ios_openmode io_mode = ios_out|ios_binary );
/** /**