Zipios++
zipfile.h
Go to the documentation of this file.
1
#ifndef ZIPFILE_H
2
#define ZIPFILE_H
3
4
#include "zipios++/zipios-config.h"
5
6
#include <vector>
7
#include "zipios++/meta-iostreams.h"
8
9
#include "
zipios++/fcoll.h
"
10
#include "
zipios++/ziphead.h
"
11
#include "
zipios++/virtualseeker.h
"
12
13
namespace
zipios {
14
15
using
std::ifstream ;
16
20
class
ZipFile
:
public
FileCollection
{
21
public
:
33
static
ZipFile
openEmbeddedZipFile
(
const
string
&name ) ;
34
37
ZipFile
() {}
38
39
/* Default Copy constructor and copy assignment operator are sufficient. */
40
55
explicit
ZipFile
(
const
string
&name,
int
s_off = 0,
int
e_off = 0
56
/* , ios::open_mode mode = ios::in | ios::binary */
) ;
57
58
virtual
FileCollection
*
clone
()
const
;
59
61
virtual
~ZipFile
() ;
62
63
virtual
void
close
() ;
64
65
virtual
istream *
getInputStream
(
const
ConstEntryPointer
&entry ) ;
66
virtual
istream *
getInputStream
(
const
string
&entry_name,
67
MatchPath matchpath = MATCH ) ;
68
private
:
69
VirtualSeeker
_vs ;
70
EndOfCentralDirectory
_eocd ;
71
72
bool
init( istream &_zipfile ) ;
73
bool
readCentralDirectory( istream &_zipfile ) ;
74
bool
readEndOfCentralDirectory( istream &_zipfile ) ;
75
bool
confirmLocalHeaders( istream &_zipfile ) ;
76
void
setError(
string
error_str ) ;
77
};
78
79
80
}
81
82
#endif
83
87
88
/*
89
Zipios++ - a small C++ library that provides easy access to .zip files.
90
Copyright (C) 2000 Thomas Søndergaard
91
92
This library is free software; you can redistribute it and/or
93
modify it under the terms of the GNU Lesser General Public
94
License as published by the Free Software Foundation; either
95
version 2 of the License, or (at your option) any later version.
96
97
This library is distributed in the hope that it will be useful,
98
but WITHOUT ANY WARRANTY; without even the implied warranty of
99
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
100
Lesser General Public License for more details.
101
102
You should have received a copy of the GNU Lesser General Public
103
License along with this library; if not, write to the Free Software
104
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
105
*/
zipios::EndOfCentralDirectory
The end of the Central directory structure.
Definition
ziphead.h:159
zipios::FileCollection
FileCollection is an abstract baseclass that represents a collection of files.
Definition
fcoll.h:21
zipios::FileCollection::FileCollection
FileCollection()
FileCollection constructor.
Definition
fcoll.h:24
zipios::VirtualSeeker
VirtualSeeker is a simple class that keeps track of a set of specified 'virtual' file endings that ma...
Definition
virtualseeker.h:20
zipios::ZipFile::~ZipFile
virtual ~ZipFile()
Destructor.
Definition
zipfile.cpp:46
zipios::ZipFile::close
virtual void close()
Closes the FileCollection.
Definition
zipfile.cpp:50
zipios::ZipFile::ZipFile
ZipFile()
Default constructor.
Definition
zipfile.h:37
zipios::ZipFile::openEmbeddedZipFile
static ZipFile openEmbeddedZipFile(const string &name)
Opens a Zip archive embedded in another file, by writing the zip archive to the end of the file follo...
Definition
zipfile.cpp:19
zipios::ZipFile::clone
virtual FileCollection * clone() const
Create a heap allocated clone of the object this method is called for.
Definition
zipfile.cpp:41
zipios::ZipFile::getInputStream
virtual istream * getInputStream(const ConstEntryPointer &entry)
Returns a pointer to an opened istream for the specified FileEntry.
Definition
zipfile.cpp:55
fcoll.h
Header file that defines FileCollection.
zipios::ConstEntryPointer
SimpleSmartPointer< const FileEntry > ConstEntryPointer
ConstEntryPointer is a SimpleSmartPointer for const FileEntry's.
Definition
fileentry.h:37
virtualseeker.h
Header file that defines VirtualSeeker.
ziphead.h
Header file containing classes and functions for reading the central directory and local header field...
zipios++
zipfile.h
Generated by
1.14.0