zipios::ZipOutputStreambuf Class Reference

ZipOutputStreambuf is a zip output streambuf filter. More...

#include <zipoutputstreambuf.h>

Public Types

enum  CompressionLevels { NO_COMPRESSION = Z_NO_COMPRESSION , BEST_SPEED = Z_BEST_SPEED , BEST_COMPRESSION = Z_BEST_COMPRESSION , DEFAULT_COMPRESSION = Z_DEFAULT_COMPRESSION }
 

Public Member Functions

void close ()
 Calls finish. More...
 
void closeEntry ()
 Closes the current entry, and positions the stream read pointer at the beginning of the next entry (if there is one). More...
 
void finish ()
 Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream. More...
 
void putNextEntry (const ZipCDirEntry &entry)
 Begins writing the next entry. More...
 
void setComment (const string &comment)
 Sets the global comment for the Zip archive. More...
 
void setLevel (int level)
 Sets the compression level to be used for subsequent entries. More...
 
void setMethod (StorageMethod method)
 Sets the compression method to be used. More...
 
 ZipOutputStreambuf (streambuf *outbuf, bool del_outbuf=false)
 ZipOutputStreambuf constructor. More...
 
virtual ~ZipOutputStreambuf ()
 Destructor. More...
 
- Public Member Functions inherited from zipios::DeflateOutputStreambuf
bool closeStream ()
 
 DeflateOutputStreambuf (streambuf *outbuf, bool user_init=false, bool del_outbuf=false)
 DeflateOutputStreambuf constructor. More...
 
uint32 getCount () const
 Returns the number of bytes written to the streambuf, that has been processed from the input buffer by the compressor. More...
 
uint32 getCrc32 () const
 Returns the CRC32 for the current stream. More...
 
bool init (int comp_level=6)
 
virtual ~DeflateOutputStreambuf ()
 Destructor. More...
 
- Public Member Functions inherited from zipios::FilterOutputStreambuf
 FilterOutputStreambuf (streambuf *outbuf, bool del_outbuf=false)
 Constructor. More...
 
virtual ~FilterOutputStreambuf ()
 Destructor. More...
 

Protected Member Functions

virtual int overflow (int c=EOF)
 
void setEntryClosedState ()
 
virtual int sync ()
 
void updateEntryHeaderInfo ()
 
- Protected Member Functions inherited from zipios::DeflateOutputStreambuf
void endDeflation ()
 Flushes the remaining data in the zlib buffers, after which the only possible operations are deflateEnd() or deflateReset(). More...
 
bool flushOutvec ()
 Flushes _outvec and updates _zs.next_out and _zs.avail_out. More...
 
virtual int overflow (int c=EOF)
 
virtual int sync ()
 

Static Protected Member Functions

static void writeCentralDirectory (const vector< ZipCDirEntry > &entries, EndOfCentralDirectory eocd, ostream &os)
 

Detailed Description

ZipOutputStreambuf is a zip output streambuf filter.


Member Enumeration Documentation

◆ CompressionLevels

Enumerator
NO_COMPRESSION 
BEST_SPEED 
BEST_COMPRESSION 
DEFAULT_COMPRESSION 

Constructor & Destructor Documentation

◆ ZipOutputStreambuf()

zipios::ZipOutputStreambuf::ZipOutputStreambuf ( streambuf *  outbuf,
bool  del_outbuf = false 
)
explicit

ZipOutputStreambuf constructor.

A newly constructed ZipOutputStreambuf is not ready to accept data, putNextEntry() must be invoked first.

Parameters
outbufthe streambuf to use for input.
del_outbufif true is specified outbuf will be deleted, when the ZipOutputStreambuf is destructed.

◆ ~ZipOutputStreambuf()

zipios::ZipOutputStreambuf::~ZipOutputStreambuf ( )
virtual

Destructor.

References finish().

Member Function Documentation

◆ close()

void zipios::ZipOutputStreambuf::close ( )

◆ closeEntry()

void zipios::ZipOutputStreambuf::closeEntry ( )

Closes the current entry, and positions the stream read pointer at the beginning of the next entry (if there is one).

References zipios::DeflateOutputStreambuf::closeStream(), setEntryClosedState(), and updateEntryHeaderInfo().

Referenced by zipios::ZipOutputStream::closeEntry(), finish(), and putNextEntry().

◆ finish()

void zipios::ZipOutputStreambuf::finish ( )

Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream.

The output stream that the zip archive is being written to is not closed.

References closeEntry(), and writeCentralDirectory().

Referenced by drafttaskpanels.task_circulararray.TaskPanelCircularArray::accept(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::accept(), drafttaskpanels.task_polararray.TaskPanelPolarArray::accept(), draftguitools.gui_arcs.Arc::action(), draftguitools.gui_beziers.BezCurve::action(), draftguitools.gui_beziers.CubicBezCurve::action(), draftguitools.gui_dimensions.Dimension::action(), draftguitools.gui_ellipses.Ellipse::action(), draftguitools.gui_fillets.Fillet::action(), draftguitools.gui_labels.Label::action(), draftguitools.gui_lines.Line::action(), draftguitools.gui_mirror.Mirror::action(), draftguitools.gui_move.Move::action(), draftguitools.gui_offset.Offset::action(), draftguitools.gui_polygons.Polygon::action(), draftguitools.gui_rectangles.Rectangle::action(), draftguitools.gui_rotate.Rotate::action(), draftguitools.gui_scale.Scale::action(), draftguitools.gui_selectplane.Draft_SelectPlane::action(), draftguitools.gui_shapestrings.ShapeString::action(), draftguitools.gui_splines.BSpline::action(), draftguitools.gui_split.Split::action(), draftguitools.gui_stretch.Stretch::action(), draftguitools.gui_texts.Text::action(), draftguitools.gui_trimex.Trimex::action(), draftguitools.gui_subelements.SubelementHighlight::action(), draftguitools.gui_clone.Clone::Activated(), draftguitools.gui_dimensions.Dimension::Activated(), draftguitools.gui_downgrade.Downgrade::Activated(), draftguitools.gui_draft2sketch.Draft2Sketch::Activated(), draftguitools.gui_edit.Edit::Activated(), draftguitools.gui_facebinders.Facebinder::Activated(), draftguitools.gui_join.Join::Activated(), draftguitools.gui_shape2dview.Shape2DView::Activated(), draftguitools.gui_subelements.SubelementHighlight::Activated(), draftguitools.gui_upgrade.Upgrade::Activated(), draftguitools.gui_wire2spline.WireToBSpline::Activated(), draftguitools.gui_selectplane.Draft_SelectPlane::checkSelection(), DraftGui.DraftToolBar::checkSpecialChars(), draftguitools.gui_points.Point::click(), close(), draftguitools.gui_labels.Label::create(), draftguitools.gui_ellipses.Ellipse::createObject(), draftguitools.gui_rectangles.Rectangle::createObject(), draftguitools.gui_shapestrings.ShapeString::createObject(), draftguitools.gui_texts.Text::createObject(), draftviewproviders.view_text.ViewProviderText::createObject(), draftguitools.gui_stretch.Stretch::doStretch(), draftguitools.gui_arcs.Arc::drawArc(), draftguitools.gui_polygons.Polygon::drawPolygon(), DraftGui.DraftToolBar::escape(), zipios::ZipOutputStream::finish(), draftguitools.gui_move.Move::get_object_selection(), draftguitools.gui_rotate.Rotate::get_object_selection(), draftguitools.gui_scale.Scale::get_object_selection(), draftguitools.gui_arcs.Arc_3Points::getPoint(), draftguitools.gui_edit.Edit::keyPressed(), draftguitools.gui_dimensions.Dimension::numericInput(), draftguitools.gui_trimex.Trimex::numericRadius(), draftguitools.gui_fillets.Fillet::numericRadius(), draftguitools.gui_offset.Offset::numericRadius(), draftguitools.gui_rotate.Rotate::numericRadius(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAlign(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAuto(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickCenter(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickFront(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickMove(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickPrevious(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickSide(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickTop(), draftguitools.gui_array_simple.Array::proceed(), draftguitools.gui_clone.Clone::proceed(), draftguitools.gui_downgrade.Downgrade::proceed(), draftguitools.gui_draft2sketch.Draft2Sketch::proceed(), draftguitools.gui_edit.Edit::proceed(), draftguitools.gui_facebinders.Facebinder::proceed(), draftguitools.gui_join.Join::proceed(), draftguitools.gui_patharray.PathArray::proceed(), draftguitools.gui_pathtwistedarray.PathTwistedArray::proceed(), draftguitools.gui_pointarray.PointArray::proceed(), draftguitools.gui_shape2dview.Shape2DView::proceed(), draftguitools.gui_subelements.SubelementHighlight::proceed(), draftguitools.gui_trimex.Trimex::proceed(), draftguitools.gui_upgrade.Upgrade::proceed(), draftguitools.gui_split.Split::proceed(), draftguitools.gui_selectplane.Draft_SelectPlane::reject(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::reject(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::reject(), drafttaskpanels.task_polararray.TaskPanelPolarArray::reject(), draftguitools.gui_edit.Edit::setTrackers(), and ~ZipOutputStreambuf().

◆ overflow()

int zipios::ZipOutputStreambuf::overflow ( int  c = EOF)
protectedvirtual

◆ putNextEntry()

void zipios::ZipOutputStreambuf::putNextEntry ( const ZipCDirEntry entry)

Begins writing the next entry.

Opens the next entry in the zip archive and returns a const pointer to a FileEntry object for the entry.

Returns
a const FileEntry * containing information about the (now) current entry.

References closeEntry(), zipios::DeflateOutputStreambuf::init(), zipios::ZipCDirEntry::setLocalHeaderOffset(), and zipios::ZipLocalEntry::setMethod().

Referenced by zipios::ZipOutputStream::putNextEntry().

◆ setComment()

void zipios::ZipOutputStreambuf::setComment ( const string &  comment)

Sets the global comment for the Zip archive.

Referenced by zipios::ZipOutputStream::setComment().

◆ setEntryClosedState()

void zipios::ZipOutputStreambuf::setEntryClosedState ( )
protected

Referenced by closeEntry().

◆ setLevel()

void zipios::ZipOutputStreambuf::setLevel ( int  level)

Sets the compression level to be used for subsequent entries.

Referenced by zipios::ZipOutputStream::setLevel(), and setMethod().

◆ setMethod()

void zipios::ZipOutputStreambuf::setMethod ( StorageMethod  method)

Sets the compression method to be used.

only STORED and DEFLATED are supported.

References DEFAULT_COMPRESSION, zipios::DEFLATED, NO_COMPRESSION, setLevel(), and zipios::STORED.

Referenced by zipios::ZipOutputStream::setMethod().

◆ sync()

int zipios::ZipOutputStreambuf::sync ( )
protectedvirtual

◆ updateEntryHeaderInfo()

◆ writeCentralDirectory()

void zipios::ZipOutputStreambuf::writeCentralDirectory ( const vector< ZipCDirEntry > &  entries,
EndOfCentralDirectory  eocd,
ostream &  os 
)
staticprotected

The documentation for this class was generated from the following files: