OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ZipHandler Class Reference

Handles zipping and unzipping of files. More...

Public Types

enum  CompLevel {
  NoComp =0, SuperFast =1, Fast =3, Normal =6,
  Maximum =9
}
 

Public Member Functions

 ZipHandler ()
 
 ~ZipHandler ()
 
const char * errorMsg () const
 
bool getArchiveInfo (const char *, ObjectSet< ZipFileInfo > &)
 
bool getFileList (const char *, BufferStringSet &)
 
od_uint16 dateInDosFormat (const char *) const
 
od_uint16 timeInDosFormat (const char *) const
 
bool setTimeDateModified (const char *, od_uint16, od_uint16) const
 
bool getBitValue (const unsigned char byte, int bitposition) const
 
void setBitValue (unsigned char &byte, int bitposition, bool value) const
 

Protected Member Functions

bool initUnZipArchive (const char *, const char *)
 
bool unZipFile (const char *srcfnm, const char *fnm, const char *path)
 
bool extractNextFile ()
 
int readLocalFileHeader ()
 
bool openStreamToWrite ()
 
bool doZUnCompress ()
 
bool readEndOfCentralDirHeader ()
 
bool readCentralDirHeader (ObjectSet< ZipFileInfo > *zfileinfo=0)
 
bool readZIP64EndOfCentralDirLocator ()
 
bool readZIP64EndOfCentralDirRecord ()
 
bool readXtraFldForZIP64 (const char *, int)
 
bool readAndSetFileAttr ()
 
bool initMakeZip (const char *, const BufferStringSet &)
 
bool initAppend (const char *, const char *)
 
bool compressNextFile ()
 
bool doZCompress ()
 
int openStrmToRead (const char *src)
 
bool setLocalFileHeader ()
 
bool setLocalFileHeaderForDir ()
 
bool setLocalFileHeaderForLink ()
 
bool setZIP64Header ()
 
bool setEndOfArchiveHeaders ()
 
bool setCentralDirHeader ()
 
bool setEndOfCentralDirHeader (od_int64, od_uint32)
 
bool setZIP64EndOfDirRecord (od_int64)
 
bool setZIP64EndOfDirLocator (od_int64)
 
od_uint32 setExtFileAttr (od_uint32)
 
const BufferStringSetgetAllFileNames ()
 
od_int64 getCumulativeFileCount () const
 
int getCumulativeFileCount (int) const
 
void setCompLevel (CompLevel)
 
od_int64 getTotalSize () const
 
od_int64 getNrDoneSize () const
 
bool reportReadError (const char *filenm=0) const
 
bool reportWriteError (const char *filenm=0) const
 
bool reportStrmReadError (od_istream *, const char *) const
 
void closeInputStream ()
 
void closeOutputStream ()
 

Protected Attributes

BufferString errormsg_
 
BufferStringSet allfilenames_
 
BufferString srcfile_
 
od_uint16 srcfnmsize_
 
BufferString destbasepath_
 
BufferString destfile_
 
od_int64 compfilesize_
 
od_int64 uncompfilesize_
 
od_uint16 compmethod_
 
CompLevel complevel_
 
int curnrlevels_
 
int curinputidx_
 
int curfileidx_
 
od_int64 initialfilecount_
 
TypeSet< od_int64cumulativefilecounts_
 
od_uint16 lastmodtime_
 
od_uint16 lastmoddate_
 
od_uint32 crc_
 
od_stream_Pos offsetofcentraldir_
 
od_stream_Pos offsetoflocalheader_
 
od_int64 totalsize_
 
od_int64 nrdonesize_
 
od_ostreamostrm_
 
od_istreamistrm_
 

Friends

class ZipUtils
 
class Zipper
 
class UnZipper
 

Detailed Description

Handles zipping and unzipping of files.

Member Enumeration Documentation

Enumerator
NoComp 
SuperFast 
Fast 
Normal 
Maximum 

Constructor & Destructor Documentation

ZipHandler::ZipHandler ( )
inline
ZipHandler::~ZipHandler ( )

Member Function Documentation

void ZipHandler::closeInputStream ( )
protected
void ZipHandler::closeOutputStream ( )
protected
bool ZipHandler::compressNextFile ( )
protected
od_uint16 ZipHandler::dateInDosFormat ( const char *  ) const
bool ZipHandler::doZCompress ( )
protected
bool ZipHandler::doZUnCompress ( )
protected
const char* ZipHandler::errorMsg ( ) const
bool ZipHandler::extractNextFile ( )
protected
const BufferStringSet& ZipHandler::getAllFileNames ( )
inlineprotected
bool ZipHandler::getArchiveInfo ( const char *  ,
ObjectSet< ZipFileInfo > &   
)
bool ZipHandler::getBitValue ( const unsigned char  byte,
int  bitposition 
) const
od_int64 ZipHandler::getCumulativeFileCount ( ) const
inlineprotected
int ZipHandler::getCumulativeFileCount ( int  ) const
protected
bool ZipHandler::getFileList ( const char *  ,
BufferStringSet  
)
od_int64 ZipHandler::getNrDoneSize ( ) const
inlineprotected
od_int64 ZipHandler::getTotalSize ( ) const
inlineprotected
bool ZipHandler::initAppend ( const char *  ,
const char *   
)
protected
bool ZipHandler::initMakeZip ( const char *  ,
const BufferStringSet  
)
protected
bool ZipHandler::initUnZipArchive ( const char *  ,
const char *   
)
protected
bool ZipHandler::openStreamToWrite ( )
protected
int ZipHandler::openStrmToRead ( const char *  src)
protected
bool ZipHandler::readAndSetFileAttr ( )
protected
bool ZipHandler::readCentralDirHeader ( ObjectSet< ZipFileInfo > *  zfileinfo = 0)
protected
bool ZipHandler::readEndOfCentralDirHeader ( )
protected
int ZipHandler::readLocalFileHeader ( )
protected
bool ZipHandler::readXtraFldForZIP64 ( const char *  ,
int   
)
protected
bool ZipHandler::readZIP64EndOfCentralDirLocator ( )
protected
bool ZipHandler::readZIP64EndOfCentralDirRecord ( )
protected
bool ZipHandler::reportReadError ( const char *  filenm = 0) const
protected
bool ZipHandler::reportStrmReadError ( od_istream ,
const char *   
) const
protected
bool ZipHandler::reportWriteError ( const char *  filenm = 0) const
protected
void ZipHandler::setBitValue ( unsigned char &  byte,
int  bitposition,
bool  value 
) const
bool ZipHandler::setCentralDirHeader ( )
protected
void ZipHandler::setCompLevel ( CompLevel  )
protected
bool ZipHandler::setEndOfArchiveHeaders ( )
protected
bool ZipHandler::setEndOfCentralDirHeader ( od_int64  ,
od_uint32   
)
protected
od_uint32 ZipHandler::setExtFileAttr ( od_uint32  )
protected
bool ZipHandler::setLocalFileHeader ( )
protected
bool ZipHandler::setLocalFileHeaderForDir ( )
protected
bool ZipHandler::setLocalFileHeaderForLink ( )
protected
bool ZipHandler::setTimeDateModified ( const char *  ,
od_uint16  ,
od_uint16   
) const
bool ZipHandler::setZIP64EndOfDirLocator ( od_int64  )
protected
bool ZipHandler::setZIP64EndOfDirRecord ( od_int64  )
protected
bool ZipHandler::setZIP64Header ( )
protected
od_uint16 ZipHandler::timeInDosFormat ( const char *  ) const
bool ZipHandler::unZipFile ( const char *  srcfnm,
const char *  fnm,
const char *  path 
)
protected

Friends And Related Function Documentation

friend class UnZipper
friend
friend class Zipper
friend
friend class ZipUtils
friend

Member Data Documentation

BufferStringSet ZipHandler::allfilenames_
protected
od_int64 ZipHandler::compfilesize_
protected
CompLevel ZipHandler::complevel_
protected
od_uint16 ZipHandler::compmethod_
protected
od_uint32 ZipHandler::crc_
protected
TypeSet<od_int64> ZipHandler::cumulativefilecounts_
protected
int ZipHandler::curfileidx_
protected
int ZipHandler::curinputidx_
protected
int ZipHandler::curnrlevels_
protected
BufferString ZipHandler::destbasepath_
protected
BufferString ZipHandler::destfile_
protected
BufferString ZipHandler::errormsg_
mutableprotected
od_int64 ZipHandler::initialfilecount_
protected
od_istream* ZipHandler::istrm_
protected
od_uint16 ZipHandler::lastmoddate_
protected
od_uint16 ZipHandler::lastmodtime_
protected
od_int64 ZipHandler::nrdonesize_
protected
od_stream_Pos ZipHandler::offsetofcentraldir_
protected
od_stream_Pos ZipHandler::offsetoflocalheader_
protected
od_ostream* ZipHandler::ostrm_
protected
BufferString ZipHandler::srcfile_
protected
od_uint16 ZipHandler::srcfnmsize_
protected
od_int64 ZipHandler::totalsize_
protected
od_int64 ZipHandler::uncompfilesize_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019