Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cZipWriter Class Reference

#include <cZipWriter.h>

Public Member Functions

 cZipWriter (cStreamOutput *pOut=nullptr, const FILECHAR_t *pszRootFolder=nullptr)
 
virtual ~cZipWriter ()
 
HRESULT AddFileToZip (const FILECHAR_t *pszFilePath, ZIP_CTRL_TYPE bZCtrl=0, ZIP_COMPLEV_TYPE nCompLevel=ZIP_COMPLEV_Def, const char *pszPass=nullptr)
 
HRESULT AddFolderToZip (const FILECHAR_t *pszFolderPath, ZIP_CTRL_TYPE bZCtrl=0, ZIP_COMPLEV_TYPE nCompLevel=ZIP_COMPLEV_Def, const char *pszPass=nullptr)
 
HRESULT OpenZip (cStreamOutput *pOut, const FILECHAR_t *pszRootFolder, cStreamInput *pInpAppend=nullptr)
 
HRESULT CloseZip ()
 
 UNITTEST_FRIEND (cZipWriter)
 

Static Public Member Functions

static HRESULT GRAYCALL ZipFile (const FILECHAR_t *pszFilePath, const FILECHAR_t *pszZipFile=nullptr, ZIP_CTRL_TYPE bZCtrl=ZIP_CTRL_0, const char *pszPass=nullptr)
 
static HRESULT GRAYCALL ZipFolder (const FILECHAR_t *pszSrcRoot, const FILECHAR_t *pszDrcDir=nullptr, const FILECHAR_t *pszZipFile=nullptr, ZIP_CTRL_TYPE bZCtrl=ZIP_CTRL_0, const char *pszPass=nullptr)
 

Public Attributes

cZipDir m_dir
 central directory header. More...
 
cArrayStruct< cZipFileEntry1m_aDirEntries
 central directory entries in construction. More...
 

Protected Member Functions

HRESULT ReadZipDir (cStreamInput *pInpAppend)
 
HRESULT AddFile (ZIP_COMPLEV_TYPE nCompLevel, const char *pszPassword, cZipFileEntry1 &rEntry, cStreamInput *pInp)
 
HRESULT CloseFlush ()
 

Protected Attributes

cStreamOutputm_pOut
 zip file i am writing. More...
 
cStringF m_sRootFolder
 Subtract this from the stored file names. Root is not stored. More...
 

Detailed Description

manage compressing files and write into a new or append to existing ZIP file. This acts like a directory but it is really a compressed file.

Constructor & Destructor Documentation

◆ cZipWriter()

GrayLib::cZipWriter::cZipWriter ( cStreamOutput pOut = nullptr,
const FILECHAR_t pszRootFolder = nullptr 
)

◆ ~cZipWriter()

virtual GrayLib::cZipWriter::~cZipWriter ( )
virtual

Member Function Documentation

◆ AddFile()

HRESULT GrayLib::cZipWriter::AddFile ( ZIP_COMPLEV_TYPE  nCompLevel,
const char *  pszPassword,
cZipFileEntry1 rEntry,
cStreamInput pInp 
)
protected

◆ AddFileToZip()

HRESULT GrayLib::cZipWriter::AddFileToZip ( const FILECHAR_t pszFilePath,
ZIP_CTRL_TYPE  bZCtrl = 0,
ZIP_COMPLEV_TYPE  nCompLevel = ZIP_COMPLEV_Def,
const char *  pszPass = nullptr 
)

◆ AddFolderToZip()

HRESULT GrayLib::cZipWriter::AddFolderToZip ( const FILECHAR_t pszFolderPath,
ZIP_CTRL_TYPE  bZCtrl = 0,
ZIP_COMPLEV_TYPE  nCompLevel = ZIP_COMPLEV_Def,
const char *  pszPass = nullptr 
)

◆ CloseFlush()

HRESULT GrayLib::cZipWriter::CloseFlush ( )
protected

◆ CloseZip()

HRESULT GrayLib::cZipWriter::CloseZip ( )

◆ OpenZip()

HRESULT GrayLib::cZipWriter::OpenZip ( cStreamOutput pOut,
const FILECHAR_t pszRootFolder,
cStreamInput pInpAppend = nullptr 
)

◆ ReadZipDir()

HRESULT GrayLib::cZipWriter::ReadZipDir ( cStreamInput pInpAppend)
protected

◆ UNITTEST_FRIEND()

GrayLib::cZipWriter::UNITTEST_FRIEND ( cZipWriter  )

◆ ZipFile()

static HRESULT GRAYCALL GrayLib::cZipWriter::ZipFile ( const FILECHAR_t pszFilePath,
const FILECHAR_t pszZipFile = nullptr,
ZIP_CTRL_TYPE  bZCtrl = ZIP_CTRL_0,
const char *  pszPass = nullptr 
)
static

◆ ZipFolder()

static HRESULT GRAYCALL GrayLib::cZipWriter::ZipFolder ( const FILECHAR_t pszSrcRoot,
const FILECHAR_t pszDrcDir = nullptr,
const FILECHAR_t pszZipFile = nullptr,
ZIP_CTRL_TYPE  bZCtrl = ZIP_CTRL_0,
const char *  pszPass = nullptr 
)
static

Member Data Documentation

◆ m_aDirEntries

cArrayStruct<cZipFileEntry1> GrayLib::cZipWriter::m_aDirEntries

central directory entries in construction.

◆ m_dir

cZipDir GrayLib::cZipWriter::m_dir

central directory header.

◆ m_pOut

cStreamOutput* GrayLib::cZipWriter::m_pOut
protected

zip file i am writing.

◆ m_sRootFolder

cStringF GrayLib::cZipWriter::m_sRootFolder
protected

Subtract this from the stored file names. Root is not stored.


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