8 |
|
|
9 |
namespace zipios { |
namespace zipios { |
10 |
|
|
11 |
ZipOutputStream::ZipOutputStream( ostream &os, streampos pos ) |
ZipOutputStream::ZipOutputStream( std::ostream &os ) |
12 |
: ostream( 0 ), |
: std::ostream( 0 ), |
13 |
// SGIs basic_ifstream calls istream with 0, but calls basic_ios constructor first?? |
// SGIs basic_ifstream calls istream with 0, but calls basic_ios constructor first?? |
14 |
ofs( 0 ) |
ofs( 0 ) |
15 |
{ |
{ |
16 |
ozf = new ZipOutputStreambuf( os.rdbuf(), pos ) ; |
ozf = new ZipOutputStreambuf( os.rdbuf() ) ; |
17 |
|
|
18 |
init( ozf ) ; |
init( ozf ) ; |
19 |
} |
} |
20 |
|
|
21 |
|
|
22 |
ZipOutputStream::ZipOutputStream( const string &filename, streampos pos ) |
ZipOutputStream::ZipOutputStream( const std::string &filename ) |
23 |
: ostream( 0 ), |
: std::ostream( 0 ), |
24 |
ofs( 0 ) |
ofs( 0 ) |
25 |
{ |
{ |
26 |
ofs = new ofstream( filename.c_str(), ios::out | ios::binary ) ; |
ofs = new std::ofstream( filename.c_str(), std::ios::out | std::ios::binary ) ; |
27 |
ozf = new ZipOutputStreambuf( ofs->rdbuf(), pos ) ; |
ozf = new ZipOutputStreambuf( ofs->rdbuf() ) ; |
28 |
this->init( ozf ) ; |
this->init( ozf ) ; |
29 |
} |
} |
30 |
|
|
49 |
ozf->putNextEntry( entry ) ; |
ozf->putNextEntry( entry ) ; |
50 |
} |
} |
51 |
|
|
52 |
|
void ZipOutputStream::putNextEntry(const std::string& entryName) { |
53 |
|
putNextEntry( ZipCDirEntry(entryName)); |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
void ZipOutputStream::setComment( const string &comment ) { |
void ZipOutputStream::setComment( const std::string &comment ) { |
58 |
ozf->setComment( comment ) ; |
ozf->setComment( comment ) ; |
59 |
} |
} |
60 |
|
|