ZipCompatibility Namespace Reference

Functions that provide the proper conversion of attributes and filename strings between different system platforms and buffer operations that take into account machine's byte-order. More...


Enumerations

enum  ZipPlatforms {
  zcDosFat, zcAmiga, zcVaxVms, zcUnix,
  zcVmCms, zcAtari, zcOs2Hpfs, zcMacintosh,
  zcZsystem, zcCpm, zcNtfs
}
 The codes of the compatibility of the file attribute information. More...

Functions

bool IsPlatformSupported (int iCode)
 Check whether the system with the given code is supported by the ZipArchive library.
DWORD ConvertToSystem (DWORD uAttr, int iFromSystem, int iToSystem)
 Convert the system attributes between different system platforms.
void FileNameUpdate (CZipFileHeader &header, bool bFromZip, bool bOemConversion)
 Convert the filename of the file inside archive.
void SlashBackslashChg (CZipAutoBuffer &buffer, bool bReplaceSlash)
 Change the slash to backslash or vice-versa in buffer.
bool IsBigEndian ()
 Determine whether the current machine had a big- or little-endian architecture.
void ReadBytesBigEndian (void *pDestination, const char *pSource, int iCount)
 Read iCount bytes from pSource into pDestination.
void ReadBytesLittleEndian (void *pDestination, const char *pSource, int iCount)
 Read iCount bytes from pSource into pDestination.
void WriteBytesBigEndian (char *pDestination, const void *pSource, int iCount)
 Write iCount bytes from pSource into pDestination.
void WriteBytesLittleEndian (char *pDestination, const void *pSource, int iCount)
 Write iCount bytes from pSource into pDestination.
bool CompareBytesBigEndian (const char *pBuffer, const void *pBytes, int iCount)
 Compare iCount bytes.
bool CompareBytesLittleEndian (const char *pBuffer, const void *pBytes, int iCount)
 Compare iCount bytes.


Detailed Description

Functions that provide the proper conversion of attributes and filename strings between different system platforms and buffer operations that take into account machine's byte-order.

Enumeration Type Documentation

enum ZipCompatibility::ZipPlatforms
 

The codes of the compatibility of the file attribute information.

See also:
CZipArchive::GetSystemCompatibility

CZipFileHeader::GetSystemCompatibility

ZipPlatform::GetSystemID

Enumerator:
zcDosFat  MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems).
zcAmiga  Amiga.
zcVaxVms  VAX/VMS.
zcUnix  Unix / Linux.
zcVmCms  VM/CMS.
zcAtari  Atari ST.
zcOs2Hpfs  OS/2 H.P.F.S.
zcMacintosh  Macintosh.
zcZsystem  Z-System.
zcCpm  CP/M.
zcNtfs  Windows NTFS.

Definition at line 47 of file ZipCompatibility.h.


Function Documentation

bool ZipCompatibility::CompareBytesBigEndian const char *  pBuffer,
const void *  pBytes,
int  iCount
 

Compare iCount bytes.

Parameters:
pBuffer little-endian order
pBytes big-endian order
iCount bytes to compare

Referenced by CZipArchive::CompareBytes().

bool ZipCompatibility::CompareBytesLittleEndian const char *  pBuffer,
const void *  pBytes,
int  iCount
 

Compare iCount bytes.

Parameters:
pBuffer little-endian order
pBytes little-endian order
iCount bytes to compare

Referenced by CZipArchive::CompareBytes().

DWORD ZipCompatibility::ConvertToSystem DWORD  uAttr,
int  iFromSystem,
int  iToSystem
 

Convert the system attributes between different system platforms.

It calls one of the converting functions.

Parameters:
uAttr attributes to convert
iFromSystem system code to convert from
iToSystem system code to convert to
Returns:
the converted attributes
Note:
Throws exceptions.
See also:
ZipPlatforms

void ZipCompatibility::FileNameUpdate CZipFileHeader header,
bool  bFromZip,
bool  bOemConversion
 

Convert the filename of the file inside archive.

This conversion may not change the size of the filename, otherwise an error may occur in CZipFileHeader::ReadLocal while comparing the filename sizes.

Parameters:
header the file header to have the filename converted
bFromZip if true convert the path from the from it is stored in the archive to the current system compatible form; otherwise vice-versa.
bOemConversion if true, the OEM conversion on the filename is performed (valid only under Windows platform)
See also:
CZipCentralDir::ConvertFileName

Referenced by CZipCentralDir::ConvertFileName().

bool ZipCompatibility::IsPlatformSupported int  iCode  ) 
 

Check whether the system with the given code is supported by the ZipArchive library.

Parameters:
iCode the system code
Returns:
true if supported

void ZipCompatibility::ReadBytesBigEndian void *  pDestination,
const char *  pSource,
int  iCount
 

Read iCount bytes from pSource into pDestination.

Parameters:
pDestination big-endian order
pSource little-endian order
iCount bytes to read

Referenced by CZipArchive::ReadBytes().

void ZipCompatibility::ReadBytesLittleEndian void *  pDestination,
const char *  pSource,
int  iCount
 

Read iCount bytes from pSource into pDestination.

Parameters:
pDestination little-endian order
pSource little-endian order
iCount bytes to read

Referenced by CZipArchive::ReadBytes().

void ZipCompatibility::SlashBackslashChg CZipAutoBuffer buffer,
bool  bReplaceSlash
 

Change the slash to backslash or vice-versa in buffer.

Parameters:
buffer 
bReplaceSlash if true, change slash to backslash

void ZipCompatibility::WriteBytesBigEndian char *  pDestination,
const void *  pSource,
int  iCount
 

Write iCount bytes from pSource into pDestination.

Parameters:
pDestination little-endian order
pSource big-endian order
iCount bytes to write

Referenced by CZipArchive::WriteBytes().

void ZipCompatibility::WriteBytesLittleEndian char *  pDestination,
const void *  pSource,
int  iCount
 

Write iCount bytes from pSource into pDestination.

Parameters:
pDestination little-endian order
pSource little-endian order
iCount bytes to write

Referenced by CZipArchive::WriteBytes().


ZipArchive Copyright © 2000 - 2006 Tadeusz Dracz . Generated at Fri Apr 7 13:55:25 2006.