OpendTect  6.6
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static 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 ()
 
od_uint16 dateInDosFormat (const char *) const
 
const char * errorMsg () const
 
bool getArchiveInfo (const char *, ObjectSet< ZipFileInfo > &)
 
bool getBitValue (const unsigned char byte, int bitposition) const
 
bool getFileList (const char *, BufferStringSet &)
 
void setBitValue (unsigned char &byte, int bitposition, bool value) const
 
bool setTimeDateModified (const char *, od_uint16, od_uint16) const
 
od_uint16 timeInDosFormat (const char *) const
 

Static Public Member Functions

static BufferString logMessage ()
 

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static BufferString logmsg_
 

Friends

class MultiArchiveUnZipper
 
class UnZipper
 
class Zipper
 
class ZipUtils
 

Detailed Description

Handles zipping and unzipping of files.

<>

Member Enumeration Documentation

◆ CompLevel

Enumerator
NoComp 
SuperFast 
Fast 
Normal 
Maximum 

Constructor & Destructor Documentation

◆ ZipHandler()

ZipHandler::ZipHandler ( )
inline

◆ ~ZipHandler()

ZipHandler::~ZipHandler ( )

Member Function Documentation

◆ closeInputStream()

void ZipHandler::closeInputStream ( )
protected

◆ closeOutputStream()

void ZipHandler::closeOutputStream ( )
protected

◆ compressNextFile()

bool ZipHandler::compressNextFile ( )
protected

◆ dateInDosFormat()

od_uint16 ZipHandler::dateInDosFormat ( const char *  ) const

◆ doZCompress()

bool ZipHandler::doZCompress ( )
protected

◆ doZUnCompress()

bool ZipHandler::doZUnCompress ( )
protected

◆ errorMsg()

const char* ZipHandler::errorMsg ( ) const

◆ extractNextFile()

bool ZipHandler::extractNextFile ( )
protected

◆ getAllFileNames()

const BufferStringSet& ZipHandler::getAllFileNames ( )
inlineprotected

◆ getArchiveInfo()

bool ZipHandler::getArchiveInfo ( const char *  ,
ObjectSet< ZipFileInfo > &   
)

◆ getBitValue()

bool ZipHandler::getBitValue ( const unsigned char  byte,
int  bitposition 
) const

◆ getCumulativeFileCount() [1/2]

od_int64 ZipHandler::getCumulativeFileCount ( ) const
inlineprotected

◆ getCumulativeFileCount() [2/2]

int ZipHandler::getCumulativeFileCount ( int  ) const
protected

◆ getFileList()

bool ZipHandler::getFileList ( const char *  ,
BufferStringSet  
)

◆ getNrDoneSize()

od_int64 ZipHandler::getNrDoneSize ( ) const
inlineprotected

◆ getTotalSize()

od_int64 ZipHandler::getTotalSize ( ) const
inlineprotected

◆ initAppend()

bool ZipHandler::initAppend ( const char *  ,
const char *   
)
protected

◆ initMakeZip()

bool ZipHandler::initMakeZip ( const char *  ,
const BufferStringSet  
)
protected

◆ initUnZipArchive()

bool ZipHandler::initUnZipArchive ( const char *  ,
const char *   
)
protected

◆ logMessage()

static BufferString ZipHandler::logMessage ( )
inlinestatic

◆ openStreamToWrite()

bool ZipHandler::openStreamToWrite ( )
protected

◆ openStrmToRead()

int ZipHandler::openStrmToRead ( const char *  src)
protected

◆ readAndSetFileAttr()

bool ZipHandler::readAndSetFileAttr ( )
protected

◆ readCentralDirHeader()

bool ZipHandler::readCentralDirHeader ( ObjectSet< ZipFileInfo > *  zfileinfo = 0)
protected

◆ readEndOfCentralDirHeader()

bool ZipHandler::readEndOfCentralDirHeader ( )
protected

◆ readLocalFileHeader()

int ZipHandler::readLocalFileHeader ( )
protected

◆ readXtraFldForZIP64()

bool ZipHandler::readXtraFldForZIP64 ( const char *  ,
int   
)
protected

◆ readZIP64EndOfCentralDirLocator()

bool ZipHandler::readZIP64EndOfCentralDirLocator ( )
protected

◆ readZIP64EndOfCentralDirRecord()

bool ZipHandler::readZIP64EndOfCentralDirRecord ( )
protected

◆ reportReadError()

bool ZipHandler::reportReadError ( const char *  filenm = 0) const
protected

◆ reportStrmReadError()

bool ZipHandler::reportStrmReadError ( od_istream ,
const char *   
) const
protected

◆ reportWriteError()

bool ZipHandler::reportWriteError ( const char *  filenm = 0) const
protected

◆ setBitValue()

void ZipHandler::setBitValue ( unsigned char &  byte,
int  bitposition,
bool  value 
) const

◆ setCentralDirHeader()

bool ZipHandler::setCentralDirHeader ( )
protected

◆ setCompLevel()

void ZipHandler::setCompLevel ( CompLevel  )
protected

◆ setEndOfArchiveHeaders()

bool ZipHandler::setEndOfArchiveHeaders ( )
protected

◆ setEndOfCentralDirHeader()

bool ZipHandler::setEndOfCentralDirHeader ( od_int64  ,
od_uint32   
)
protected

◆ setExtFileAttr()

od_uint32 ZipHandler::setExtFileAttr ( od_uint32  )
protected

◆ setLocalFileHeader()

bool ZipHandler::setLocalFileHeader ( )
protected

◆ setLocalFileHeaderForDir()

bool ZipHandler::setLocalFileHeaderForDir ( )
protected

◆ setLocalFileHeaderForLink()

bool ZipHandler::setLocalFileHeaderForLink ( )
protected

◆ setTimeDateModified()

bool ZipHandler::setTimeDateModified ( const char *  ,
od_uint16  ,
od_uint16   
) const

◆ setZIP64EndOfDirLocator()

bool ZipHandler::setZIP64EndOfDirLocator ( od_int64  )
protected

◆ setZIP64EndOfDirRecord()

bool ZipHandler::setZIP64EndOfDirRecord ( od_int64  )
protected

◆ setZIP64Header()

bool ZipHandler::setZIP64Header ( )
protected

◆ timeInDosFormat()

od_uint16 ZipHandler::timeInDosFormat ( const char *  ) const

◆ unZipFile()

bool ZipHandler::unZipFile ( const char *  srcfnm,
const char *  fnm,
const char *  path 
)
protected

Friends And Related Function Documentation

◆ MultiArchiveUnZipper

friend class MultiArchiveUnZipper
friend

◆ UnZipper

friend class UnZipper
friend

◆ Zipper

friend class Zipper
friend

◆ ZipUtils

friend class ZipUtils
friend

Member Data Documentation

◆ allfilenames_

BufferStringSet ZipHandler::allfilenames_
protected

◆ compfilesize_

od_int64 ZipHandler::compfilesize_
protected

◆ complevel_

CompLevel ZipHandler::complevel_
protected

◆ compmethod_

od_uint16 ZipHandler::compmethod_
protected

◆ crc_

od_uint32 ZipHandler::crc_
protected

◆ cumulativefilecounts_

TypeSet<od_int64> ZipHandler::cumulativefilecounts_
protected

◆ curfileidx_

int ZipHandler::curfileidx_
protected

◆ curinputidx_

int ZipHandler::curinputidx_
protected

◆ curnrlevels_

int ZipHandler::curnrlevels_
protected

◆ destbasepath_

BufferString ZipHandler::destbasepath_
protected

◆ destfile_

BufferString ZipHandler::destfile_
protected

◆ errormsg_

BufferString ZipHandler::errormsg_
mutableprotected

◆ initialfilecount_

od_int64 ZipHandler::initialfilecount_
protected

◆ istrm_

od_istream* ZipHandler::istrm_
protected

◆ lastmoddate_

od_uint16 ZipHandler::lastmoddate_
protected

◆ lastmodtime_

od_uint16 ZipHandler::lastmodtime_
protected

◆ logmsg_

BufferString ZipHandler::logmsg_
staticprotected

◆ nrdonesize_

od_int64 ZipHandler::nrdonesize_
protected

◆ offsetofcentraldir_

od_stream_Pos ZipHandler::offsetofcentraldir_
protected

◆ offsetoflocalheader_

od_stream_Pos ZipHandler::offsetoflocalheader_
protected

◆ ostrm_

od_ostream* ZipHandler::ostrm_
protected

◆ srcfile_

BufferString ZipHandler::srcfile_
protected

◆ srcfnmsize_

od_uint16 ZipHandler::srcfnmsize_
protected

◆ totalsize_

od_int64 ZipHandler::totalsize_
protected

◆ uncompfilesize_

od_int64 ZipHandler::uncompfilesize_
protected

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