2
#include "zipios-config.h"
4
#include "meta-iostreams.h"
6
#include "zipinputstreambuf.h"
7
#include "zipinputstream.h"
8
#if defined(_WIN32) && defined(ZIPIOS_UTF8)
9
#include <Base/FileInfo.h>
16
ZipInputStream::ZipInputStream( std::istream &is, std::streampos pos )
17
: std::istream( nullptr ),
18
// SGIs basic_ifstream calls istream with 0, but calls basic_ios constructor first??
21
izf = new ZipInputStreambuf( is.rdbuf(), pos ) ;
22
// this->rdbuf( izf ) ; is replaced by:
26
ZipInputStream::ZipInputStream( const std::string &filename, std::streampos pos )
27
: std::istream( nullptr ),
30
#if defined(_WIN32) && defined(ZIPIOS_UTF8)
31
std::wstring wsname = Base::FileInfo(filename).toStdWString();
32
ifs = new std::ifstream( wsname.c_str(), std::ios::in |std:: ios::binary ) ;
34
ifs = new std::ifstream( filename.c_str(), std::ios::in |std:: ios::binary ) ;
36
izf = new ZipInputStreambuf( ifs->rdbuf(), pos ) ;
37
// this->rdbuf( izf ) ; is replaced by:
41
int ZipInputStream::available() {
42
return 1 ; // FIXME: Dummy implementation
45
void ZipInputStream::closeEntry() {
49
void ZipInputStream::close() {
53
// ZipLocalEntry *ZipInputStream::createZipCDirEntry( const string
56
ConstEntryPointer ZipInputStream::getNextEntry() {
57
clear() ; // clear eof and other flags.
58
return izf->getNextEntry() ;
61
ZipInputStream::~ZipInputStream() {
62
// It's ok to call delete with a Null pointer.
70
Implementation of ZipInputStream.
74
Zipios++ - a small C++ library that provides easy access to .zip files.
75
Copyright (C) 2000 Thomas Søndergaard
77
This library is free software; you can redistribute it and/or
78
modify it under the terms of the GNU Lesser General Public
79
License as published by the Free Software Foundation; either
80
version 2 of the License, or (at your option) any later version.
82
This library is distributed in the hope that it will be useful,
83
but WITHOUT ANY WARRANTY; without even the implied warranty of
84
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
85
Lesser General Public License for more details.
87
You should have received a copy of the GNU Lesser General Public
88
License along with this library; if not, write to the Free Software
89
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA