ZipPlatform Namespace Reference

Interface to the system API. More...


Various operations on files and directories.

All the functions which are returning a bool value, return true when the operation was successful.

ZIP_API bool GetCurrentDirectory (CZipString &sz)
 Get the current directory and store it in sz.
ZIP_API bool ChangeDirectory (LPCTSTR lpDirectory)
ZIP_API bool SetFileAttr (LPCTSTR lpFileName, DWORD uAttr)
ZIP_API bool GetFileAttr (LPCTSTR lpFileName, DWORD &uAttr)
ZIP_API bool GetFileModTime (LPCTSTR lpFileName, time_t &ttime)
 get the file modification time
ZIP_API bool GetFileSize (LPCTSTR lpszFileName, DWORD &dSize)
ZIP_API bool SetFileModTime (LPCTSTR lpFileName, time_t ttime)
 set the file modification time
ZIP_API bool CreateDirectory (LPCTSTR lpDirectory)
ZIP_API bool SetVolLabel (LPCTSTR lpszPath, LPCTSTR lpszLabel)
 lpszPath may point to a file on the device
ZIP_API bool ForceDirectory (LPCTSTR lpDirectory)
 create nested directories at once
ZIP_API bool RemoveFile (LPCTSTR lpszFileName, bool bThrow=true)
ZIP_API bool RenameFile (LPCTSTR lpszOldName, LPCTSTR lpszNewName, bool bThrow=true)
ZIP_API bool TruncateFile (int iDes, DWORD iSize)
ZIP_API int OpenFile (LPCTSTR lpszFileName, UINT iMode, int iShareMode)
ZIP_API bool FlushFile (int iDes)
 flush the file to the disk.
ZIP_API int GetFileSystemHandle (int iDes)
 return the underlying system handle

Functions

ZIP_API bool GetSystemCaseSensitivity ()
 return the default system case-sensitivity
ZIP_API int GetSystemID ()
ZIP_API DWORD GetDefaultAttributes ()
ZIP_API DWORD GetDefaultDirAttributes ()
ZIP_API DWORD GetDeviceFreeSpace (LPCTSTR lpszPath)
 Get the free space on the device pointed by lpszPath.
ZIP_API CZipString GetTmpFileName (LPCTSTR lpszPath=NULL, DWORD iSizeNeeded=DWORD(-1))
 Return the temporary file name ensuring there is enough size in the destination directory,.
ZIP_API bool DirectoryExists (LPCTSTR lpszDir)
ZIP_API bool IsDriveRemovable (LPCTSTR lpszFilePath)
ZIP_API bool IsDirectory (DWORD uAttr)
ZIP_API void AnsiOem (CZipAutoBuffer &buffer, bool bAnsiToOem)
 Perform the translation between ANSI and OEM character sets.
ZIP_API int FileExists (LPCTSTR lpszName)
 Check if the given file or directory exists.
ZIP_API int WideToSingle (LPCTSTR lpWide, CZipAutoBuffer &szSingle, bool bUseAnsi)
 Convert wide character string to single character string.
ZIP_API int SingleToWide (const CZipAutoBuffer &szSingle, CZipString &szWide, bool bUseAnsi)
 Convert single character string to wide character string.


Detailed Description

Interface to the system API.

All functions have a system - specific implementation .


Function Documentation

ZIP_API void ZipPlatform::AnsiOem CZipAutoBuffer buffer,
bool  bAnsiToOem
 

Perform the translation between ANSI and OEM character sets.

Remarks:
  • The conversion is performed only for the zip archives created under Windows platform.
  • Windows archiving programs convert a filename to OEM before adding it to the archive.
  • OEM conversion only influences the ANSI values above 126, so it affects only strings containing international characters.
Parameters:
buffer buffer to be translated
bAnsiToOem if true, convert ANSI to OEM if false, OEM to ANSI

ZIP_API bool ZipPlatform::DirectoryExists LPCTSTR  lpszDir  ) 
 

Parameters:
lpszDir 
Returns:
true, if lpszDir directory exists; otherwise false;

ZIP_API int ZipPlatform::FileExists LPCTSTR  lpszName  ) 
 

Check if the given file or directory exists.

Parameters:
lpszName 
Returns:
  • -1 if the given file is a directory
  • 1 a file
  • 0 if there is no such a file

ZIP_API DWORD ZipPlatform::GetDefaultAttributes  ) 
 

Returns:
the default file attributes for the current system

ZIP_API DWORD ZipPlatform::GetDefaultDirAttributes  ) 
 

Returns:
the default directory attributes for the current system

ZIP_API int ZipPlatform::GetSystemID  ) 
 

Returns:
A current system name tag. May be one of ZipCompatibility::ZipPlatforms values.
See also:
CZipArchive::GetSystemCompatibility

ZIP_API CZipString ZipPlatform::GetTmpFileName LPCTSTR  lpszPath = NULL,
DWORD  iSizeNeeded = DWORD(-1)
 

Return the temporary file name ensuring there is enough size in the destination directory,.

Checking for the size is disabled by default.

ZIP_API bool ZipPlatform::IsDirectory DWORD  uAttr  ) 
 

Parameters:
uAttr attributes value to test
Returns:
true if the attributes are the directory attributes

ZIP_API bool ZipPlatform::IsDriveRemovable LPCTSTR  lpszFilePath  ) 
 

Parameters:
lpszFilePath may point to a file path or a directory on the device
Returns:
true if the drive is removable. Implemented only on Windows system, in all others always returns true.

ZIP_API int ZipPlatform::SingleToWide const CZipAutoBuffer szSingle,
CZipString &  szWide,
bool  bUseAnsi
 

Convert single character string to wide character string.

Parameters:
szSingle single string to convert (no terminating NULL character at the end)
szWide receives the wide string after the conversion
bUseAnsi if true, CP_ACP code page is used for the conversion, otherwise CP_UTF8 is used
Returns:
the length of the string after the conversion (without the NULL character), or -1 when not succeeded
Note:
Only in UNICODE version.

ZIP_API int ZipPlatform::WideToSingle LPCTSTR  lpWide,
CZipAutoBuffer szSingle,
bool  bUseAnsi
 

Convert wide character string to single character string.

Parameters:
lpWide Wide string to convert
szSingle buffer to receive converted string (without the terminating NULL character)
bUseAnsi if true, CP_ACP code page is used for the conversion, otherwise CP_UTF8 is used
Returns:
the szSingle buffer length, or -1 when not succeeded
Note:
Only in UNICODE version.


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