Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | Related Pages

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)
 Convert wide character string to single character string.

ZIP_API int SingleToWide (const CZipAutoBuffer &szSingle, CZipString &szWide)
 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 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 DirectoryExists LPCTSTR  lpszDir  ) 
 

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

ZIP_API int 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 GetDefaultAttributes  ) 
 

Returns:
the default file attributes for the current system

ZIP_API DWORD GetDefaultDirAttributes  ) 
 

Returns:
the default directory attributes for the current system

ZIP_API int GetSystemID  ) 
 

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

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,.

Checking for the size is disabled by default.

ZIP_API bool IsDirectory DWORD  uAttr  ) 
 

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

ZIP_API bool 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 SingleToWide const CZipAutoBuffer szSingle,
CZipString &  szWide
 

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
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 WideToSingle LPCTSTR  lpWide,
CZipAutoBuffer szSingle
 

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)
Returns:
the szSingle buffer length, or -1 when not succeeded
Note:
Only in UNICODE version.


ZipArchive Copyright © 2000-2003 Tadeusz Dracz . Generated at Thu Jun 26 10:45:30 2003.