12 |
|
|
13 |
namespace zipios { |
namespace zipios { |
14 |
|
|
|
using std::ifstream ; |
|
|
|
|
15 |
/** \anchor ZipOutputStream_anchor |
/** \anchor ZipOutputStream_anchor |
16 |
ZipOutputStream is an ostream that writes the output to a zip file. The |
ZipOutputStream is an ostream that writes the output to a zip file. The |
17 |
interface approximates the interface of the Java ZipOutputStream. */ |
interface approximates the interface of the Java ZipOutputStream. */ |
18 |
class ZipOutputStream : public ostream { |
class ZipOutputStream : public std::ostream { |
19 |
public: |
public: |
20 |
|
|
21 |
/** ZipOutputStream constructor. |
/** ZipOutputStream constructor. |
22 |
@param os ostream to which the compressed zip archive is written. |
@param os ostream to which the compressed zip archive is written. |
23 |
@param pos position to reposition the ostream to before reading. */ |
@param pos position to reposition the ostream to before reading. */ |
24 |
explicit ZipOutputStream( ostream &os, streampos pos = 0 ) ; |
explicit ZipOutputStream( std::ostream &os ) ; |
25 |
|
|
26 |
/** ZipOutputStream constructor. |
/** ZipOutputStream constructor. |
27 |
@filename filename to write the zip archive to. |
@filename filename to write the zip archive to. */ |
28 |
@param pos position to reposition the ostream to before writing. */ |
explicit ZipOutputStream( const std::string &filename ) ; |
|
explicit ZipOutputStream( const string &filename, streampos pos = 0 ) ; |
|
29 |
|
|
30 |
/** Closes the current entry updates its header with the relevant |
/** Closes the current entry updates its header with the relevant |
31 |
size information and positions the stream write pointer for the |
size information and positions the stream write pointer for the |
47 |
|
|
48 |
/** \anchor ZipOutputStream_putnextentry_anchor |
/** \anchor ZipOutputStream_putnextentry_anchor |
49 |
Begins writing the next entry. |
Begins writing the next entry. |
50 |
Opens the next entry in the zip archive and returns a const pointer to a |
*/ |
|
FileEntry object for the entry. |
|
|
@return a const FileEntry * containing information about the (now) current |
|
|
entry. */ |
|
51 |
void putNextEntry( const ZipCDirEntry &entry ) ; |
void putNextEntry( const ZipCDirEntry &entry ) ; |
52 |
|
|
53 |
|
/** \anchor ZipOutputStream_putnextentry2_anchor |
54 |
|
Begins writing the next entry. |
55 |
|
*/ |
56 |
|
void putNextEntry(const std::string& entryName); |
57 |
|
|
58 |
/** Sets the global comment for the Zip archive. */ |
/** Sets the global comment for the Zip archive. */ |
59 |
void setComment( const string &comment ) ; |
void setComment( const std::string& comment ) ; |
60 |
|
|
61 |
/** Sets the compression level to be used for subsequent entries. */ |
/** Sets the compression level to be used for subsequent entries. */ |
62 |
void setLevel( int level ) ; |
void setLevel( int level ) ; |
69 |
virtual ~ZipOutputStream() ; |
virtual ~ZipOutputStream() ; |
70 |
|
|
71 |
private: |
private: |
72 |
ofstream *ofs ; |
std::ofstream *ofs ; |
73 |
ZipOutputStreambuf *ozf ; |
ZipOutputStreambuf *ozf ; |
74 |
}; |
}; |
75 |
|
|