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

CZipExtraField Class Reference

#include <ZipExtraField.h>

List of all members.


Public Member Functions

int Add (CZipExtraData *pExtra)
CZipExtraDataCreateNew (WORD headerID, int &idx)
CZipExtraDataCreateNew (WORD headerID)
 CZipExtraField (const CZipExtraField &arr)
CZipExtraDataGetAt (int index) const
int GetCount () const
int GetTotalSize () const
bool HasHeader (WORD headerID)
CZipExtraDataLookup (WORD headerID, int &index) const
CZipExtraDataLookup (WORD headerID) const
CZipExtraFieldoperator= (const CZipExtraField &field)
void RemoveAt (int index)
void RemoveInternalHeaders ()
bool Validate () const

Protected Member Functions

void Clear ()
bool Read (CZipStorage *pStorage, WORD uSize)
void Write (char *buffer) const

Friends

class CZipFileHeader

Detailed Description

Represents a local or central extra field in a zip archive. This is a collection of extra data records (CZipExtraData).

See also:
Providing Custom Data: Extra Fields

CZipExtraData


Member Function Documentation

int CZipExtraField::Add ( CZipExtraData pExtra  )  [inline]

Adds a new extra data record to the extra field.

Parameters:
pExtra The extra data record to add.
Returns:
The index of pExtra in the internal collection.

void CZipExtraField::Clear (  )  [inline, protected]

Removes all extra data records from the extra field.

CZipExtraData* CZipExtraField::CreateNew ( WORD  headerID,
int &  idx 
) [inline]

Creates a new extra data record with the given ID and adds it to the extra field.

Parameters:
headerID The extra data ID.
idx Receives the value of the index of the new extra data in the internal collection.
Returns:
The created extra data record.
See also:
CZipExtraData::GetHeaderID

CZipExtraData* CZipExtraField::CreateNew ( WORD  headerID  )  [inline]

Creates a new extra data record with the given ID and adds it to the extra field.

Parameters:
headerID The extra data ID.
Returns:
The created extra data record.
See also:
CZipExtraData::GetHeaderID

CZipExtraData* CZipExtraField::GetAt ( int  index  )  const [inline]

Gets the extra data record at the given index.

Parameters:
index The index of extra data record to retrieve.
Returns:
The extra data record.

int CZipExtraField::GetCount (  )  const [inline]

Gets the number of extra data records included in the extra field.

Returns:
The number of extra fields included.

int CZipExtraField::GetTotalSize (  )  const

Gets the total size, the extra data will occupy in the archive.

Returns:
The size in bytes.

bool CZipExtraField::HasHeader ( WORD  headerID  )  [inline]

Returns the value indicating whether the extra data record with the given ID is present in the extra field.

Parameters:
headerID The ID of the extra data to check.
Returns:
true, if the extra data record with the given ID is present in the extra field; false otherwise.

CZipExtraData* CZipExtraField::Lookup ( WORD  headerID,
int &  index 
) const

Lookups the extra field for the extra data record with the given ID.

Parameters:
headerID The ID of the extra data to lookup.
index Receives the value of the index of the found extra data in the internal collection.
Returns:
The found extra data record or NULL, if the extra data could not be found.

CZipExtraData* CZipExtraField::Lookup ( WORD  headerID  )  const [inline]

Lookups the extra field for the extra data record with the given ID.

Parameters:
headerID The ID of the extra data to lookup.
Returns:
The found extra data record or NULL, if the extra data could not be found.

bool CZipExtraField::Read ( CZipStorage pStorage,
WORD  uSize 
) [protected]

Reads the extra field from buffer.

Parameters:
pStorage The storage to read the data from.
uSize The size of the data to read.
Returns:
false, if uSize was smaller than the declared extra field size; true otherwise.

void CZipExtraField::RemoveAt ( int  index  )  [inline]

Removes the extra data record at the given index.

Parameters:
index The index of the extra data record to remove.

void CZipExtraField::RemoveInternalHeaders (  ) 

Removes all extra data records from the extra field, that are internally used by the ZipArchive Library.

bool CZipExtraField::Validate (  )  const [inline]

Validates the current size of the extra field.

Returns:
false, if the size is larger than allowed; false otherwise.

void CZipExtraField::Write ( char *  buffer  )  const [protected]

Writes the extra field to buffer.

Parameters:
buffer The buffer to write to.


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