Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation

CZipAddNewFileInfo Struct Reference

#include <ZipArchive.h>

List of all members.


Public Member Functions

 CZipAddNewFileInfo (CZipAbstractFile *pFile, LPCTSTR lpszFileNameInZip)
 CZipAddNewFileInfo (LPCTSTR lpszFilePath, LPCTSTR lpszFileNameInZip)
 CZipAddNewFileInfo (LPCTSTR lpszFilePath, bool bFullPath=true)
void Defaults ()

Public Attributes

bool m_bFullPath
int m_iComprLevel
int m_iSmartLevel
unsigned long m_nBufSize
CZipAbstractFile * m_pFile
CZipString m_szFileNameInZip
CZipString m_szFilePath
ZIP_INDEX_TYPE m_uReplaceIndex

Detailed Description

The structure used as a parameter in CZipArchive::AddNewFile(CZipAddNewFileInfo& ). Use one of the provided constructors and then adjust the member variables as needed.

See also:
Compressing Data

Constructor & Destructor Documentation

CZipAddNewFileInfo::CZipAddNewFileInfo ( LPCTSTR  lpszFilePath,
bool  bFullPath = true 
) [inline]

Initializes a new instance of the CZipAddNewFileInfo class.

Parameters:
lpszFilePath Sets m_szFilePath.
bFullPath Sets m_bFullPath.

CZipAddNewFileInfo::CZipAddNewFileInfo ( LPCTSTR  lpszFilePath,
LPCTSTR  lpszFileNameInZip 
) [inline]

Initializes a new instance of the CZipAddNewFileInfo class.

Parameters:
lpszFilePath Sets m_szFilePath.
lpszFileNameInZip Sets m_szFileNameInZip.

CZipAddNewFileInfo::CZipAddNewFileInfo ( CZipAbstractFile *  pFile,
LPCTSTR  lpszFileNameInZip 
) [inline]

Initializes a new instance of the CZipAddNewFileInfo class.

Parameters:
pFile Sets m_pFile.
lpszFileNameInZip Sets m_szFileNameInZip.


Member Function Documentation

void CZipAddNewFileInfo::Defaults (  ) 

Sets default values for m_iSmartLevel, m_uReplaceIndex, m_nBufSize and m_iComprLevel. Examine the source code for the current values.


Member Data Documentation

It has only the meaning when CZipAddNewFileInfo::m_szFileNameInZip is not specified and CZipAddNewFileInfo::m_szFilePath is not empty.

The level of compression. You can use values from 0 to 9 and -1 (meaning the default compression) or one of the CZipCompressor::CompressionLevel values.

The smartness level of the file adding process. Can be one or combined CZipArchive::Smartness values (you can use the logical OR).

The size of the buffer used while file operations.

CZipAbstractFile* CZipAddNewFileInfo::m_pFile

Initialize this field to set the source data for compression to be taken from the CZipAbstractFile object (such as CZipMemFile) instead of from a physical file.

Note:
  • You have to leave m_szFilePath empty if you set m_pFile to not NULL.
  • The time of a file in zip will be set to the current time, and the attributes to the default file attributes (depending on the system).
  • You cannot add directories this way.

The file name that will be stored in the archive. If the file is a directory, there will be a path separator automatically appended. The CZipArchive::SetRootPath method has no effect on this parameter.

The full path to the file to be added. If it is empty, you need to initialize m_pFile. If m_bFullPath is true and the path contains a drive letter, the drive letter is removed unless CZipArchive::m_bRemoveDriveLetter is set to false.

The index of an existing file in the archive to be replaced by the file being added. See Modification of Archives: Replacing, Renaming, Deleting and Changing Data for more information. The meaning of its values is as follows:

  • >= 0 : the index of the file to be replaced.
  • ZIP_FILE_INDEX_UNSPECIFIED : do not replace any file and add the new file at the end of the archive (default). Use this value in segmented archives.

Note:
  • If you use an invalid index, the action will fail.
  • If you specify the last file in the archive to be replaced, it'll be removed and the usual action will be taken.
See also:
CZipArchive::SetAdvanced

CZipArchive::WillBeDuplicated


The documentation for this struct was generated from the following file:
Back To Top Up