prepare zipios++ for unicode support
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "zipios_defs.h"
|
||||
|
||||
#include "backbuffer.h"
|
||||
#include <Base/FileInfo.h>
|
||||
|
||||
namespace zipios {
|
||||
|
||||
@@ -33,7 +34,12 @@ ZipFile::ZipFile( const string &name , int s_off, int e_off
|
||||
|
||||
_filename = name ;
|
||||
|
||||
#if _WIN32
|
||||
std::wstring wsname = Base::FileInfo(name).toStdWString();
|
||||
ifstream _zipfile( wsname.c_str(), ios::in | ios::binary ) ;
|
||||
#else
|
||||
ifstream _zipfile( name.c_str(), ios::in | ios::binary ) ;
|
||||
#endif
|
||||
init( _zipfile ) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "zipinputstreambuf.h"
|
||||
#include "zipinputstream.h"
|
||||
#include <Base/FileInfo.h>
|
||||
|
||||
using std::istream;
|
||||
|
||||
@@ -24,7 +25,12 @@ ZipInputStream::ZipInputStream( const std::string &filename, std::streampos pos
|
||||
: std::istream( 0 ),
|
||||
ifs( 0 )
|
||||
{
|
||||
#if _WIN32
|
||||
std::wstring wsname = Base::FileInfo(filename).toStdWString();
|
||||
ifs = new std::ifstream( wsname.c_str(), std::ios::in |std:: ios::binary ) ;
|
||||
#else
|
||||
ifs = new std::ifstream( filename.c_str(), std::ios::in |std:: ios::binary ) ;
|
||||
#endif
|
||||
izf = new ZipInputStreambuf( ifs->rdbuf(), pos ) ;
|
||||
// this->rdbuf( izf ) ; is replaced by:
|
||||
this->init( izf ) ;
|
||||
|
||||
Reference in New Issue
Block a user