2#include "zipios++/zipios-config.h"
4#include "zipios++/meta-iostreams.h"
10using namespace zipios ;
17int main(
int ,
char *argv[] ) {
20 cout <<
"Instantiating a ZipFile" << endl ;
23 cout <<
"list length : " << zf.
size() << endl ;
29 ConstEntries::iterator it ;
30 for( it = entries.begin() ; it != entries.end() ; it++)
31 cout << *(*it) << endl ;
37 cout <<
"Contents of entry, " << ent->getName() <<
" :" << endl ;
41 cout <<
"end of main()" << endl ;
46 cerr <<
"Exception caught in main() :" << endl ;
47 cerr << excp.what() << endl ;
48 cerr <<
"\nThe invalid virtual endings exception very probably means that\n"
49 <<
"this program hasn't had a zip file appended to it with 'appendzip'\n"
50 <<
"\nTry the following command and re-run " << argv[ 0 ] <<
" :\n"
51 <<
" ./appendzip " << argv[ 0 ] <<
" test.zip\n"
54 catch( exception &excp ) {
55 cerr <<
"Exception caught in main() :" << endl ;
56 cerr << excp.what() << endl ;
An FCollException is used to signal a problem with a FileCollection.
virtual ConstEntryPointer getEntry(const string &name, MatchPath matchpath=MATCH) const
Returns a ConstEntryPointer to a FileEntry object for the entry with the specified name.
virtual ConstEntries entries() const
Returns a vector of const pointers to the entries in the FileCollection.
virtual int size() const
Returns the number of entries in the FileCollection.
SimpleSmartPointer is a simple reference counting smart pointer template.
ZipFile is a FileCollection, where the files are stored in a .zip file.
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...
virtual istream * getInputStream(const ConstEntryPointer &entry)
Returns a pointer to an opened istream for the specified FileEntry.
Header file that defines a number of exceptions used by FileCollection and its subclasses.
vector< EntryPointer > ConstEntries
ConstEntries is a vector of ConstEntryPointer's.
Header file that defines ZipFile.