Enumerations | |
enum | FileOverwriteMode { fomRegular = 0x00, fomRemoveReadOnly = 0x01, fomOnlyIfNewer = 0x02, fomRecycleBin = 0x04 } |
Functions | |
ZIP_API void | AnsiOem (CZipAutoBuffer &buffer, bool bAnsiToOem) |
ZIP_API int | FileExists (LPCTSTR lpszName) |
ZIP_API DWORD | GetDefaultAttributes () |
ZIP_API DWORD | GetDefaultDirAttributes () |
ZIP_API ULONGLONG | GetDeviceFreeSpace (LPCTSTR lpszPath) |
ZIP_API bool | GetSystemCaseSensitivity () |
ZIP_API int | GetSystemID () |
ZIP_API CZipString | GetTmpFileName (LPCTSTR lpszPath=NULL, ZIP_SIZE_TYPE uSizeNeeded=0) |
ZIP_API bool | IsDirectory (DWORD uAttr) |
ZIP_API bool | IsDriveRemovable (LPCTSTR lpszFilePath) |
ZIP_API int | MultiByteToWide (const CZipAutoBuffer &szIn, CZipString &szOut, UINT uCodePage) |
ZIP_API int | MultiByteToWide (const char *szIn, int iInSize, CZipString &szOut, UINT uCodePage) |
ZIP_API int | WideToMultiByte (LPCWSTR lpszIn, CZipAutoBuffer &szOut, UINT uCodePage) |
ZIP_API int | WideToMultiByte (LPCWSTR lpszIn, CZipAutoBuffer &szOut, bool bAddNull, UINT uCodePage) |
Various operations on files and directories. | |
If the functions returns a | |
ZIP_API bool | GetCurrentDirectory (CZipString &sz) |
Returns the current directory and stores it in sz. | |
ZIP_API bool | ChangeDirectory (LPCTSTR lpDirectory) |
Changes the current directory. | |
ZIP_API bool | SetFileAttr (LPCTSTR lpFileName, DWORD uAttr) |
Sets the file attributes. | |
ZIP_API bool | GetFileAttr (LPCTSTR lpFileName, DWORD &uAttr) |
Returns the file attributes. | |
ZIP_API bool | GetFileTimes (LPCTSTR lpFileName, time_t *tModificationTime, time_t *tCreationTime=NULL, time_t *tLastAccessTime=NULL) |
Retrieves file times. | |
ZIP_API bool | SetFileTimes (LPCTSTR lpFileName, const time_t *tModificationTime, const time_t *tCreationTime=NULL, const time_t *tLastAccessTime=NULL) |
Sets file times. | |
ZIP_API bool | GetFileSize (LPCTSTR lpszFileName, ZIP_SIZE_TYPE &dSize) |
Returns the file size. | |
ZIP_API bool | CreateNewDirectory (LPCTSTR lpDirectory) |
Creates a new directory. | |
ZIP_API bool | SetVolLabel (LPCTSTR lpszPath, LPCTSTR lpszLabel) |
Sets a label on a removable device. lpszPath may point to a file on the device. | |
ZIP_API bool | ForceDirectory (LPCTSTR lpDirectory) |
Creates nested directories at once. | |
ZIP_API bool | RemoveFile (LPCTSTR lpszFileName, bool bThrow=true, int iMode=fomRegular) |
Removes a file. | |
ZIP_API bool | RenameFile (LPCTSTR lpszOldName, LPCTSTR lpszNewName, bool bThrow=true) |
Renames a file. | |
void | ConvertTimeToFileTime (const time_t &ttime, ZFILETIME &fileTime) |
bool | ConvertFileTimeToTime (const ZFILETIME &fileTime, time_t &ttime) |
ZIP_API bool | SetFileAttr (HANDLE handle, DWORD uAttr) |
Sets the file attributes. | |
ZIP_API bool | SetFileTimes (HANDLE handle, const time_t *tModificationTime, const time_t *tCreationTime=NULL, const time_t *tLastAccessTime=NULL) |
Set file times. | |
ZIP_API bool | TruncateFile (int iDes, ULONGLONG uSize) |
ZIP_API int | OpenFile (LPCTSTR lpszFileName, UINT iMode, int iShareMode) |
ZIP_API bool | FlushFile (int iDes) |
ZIP_API intptr_t | GetFileSystemHandle (int iDes) |
Includes functions that require system-specific implementation.
The mode for deleting files.
Definition at line 43 of file ZipPlatform.h.
ZIP_API void ZipPlatform::AnsiOem | ( | CZipAutoBuffer & | buffer, |
bool | bAnsiToOem | ||
) |
Performs the translation between ANSI and OEM character sets.
buffer | The buffer containing characters to be translated. |
bAnsiToOem | If true , convert ANSI to OEM; if false , OEM to ANSI. |
ZIP_API bool ZipPlatform::ChangeDirectory | ( | LPCTSTR | lpDirectory | ) |
Changes the current directory.
ZIP_API bool ZipPlatform::CreateNewDirectory | ( | LPCTSTR | lpDirectory | ) |
Creates a new directory.
ZIP_API int ZipPlatform::FileExists | ( | LPCTSTR | lpszName | ) |
Checks if the given file or directory exists.
lpszName | The path to the file or directory to test. |
-1
: the given file exists and is a directory1
: the given file exists and is a regular file0
: there is no such a file ZIP_API bool ZipPlatform::FlushFile | ( | int | iDes | ) |
Flushes the file to the disk.
ZIP_API bool ZipPlatform::ForceDirectory | ( | LPCTSTR | lpDirectory | ) |
Creates nested directories at once.
ZIP_API bool ZipPlatform::GetCurrentDirectory | ( | CZipString & | sz | ) |
Returns the current directory and stores it in sz.
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 ULONGLONG ZipPlatform::GetDeviceFreeSpace | ( | LPCTSTR | lpszPath | ) |
Returns the free space on the given device.
lpszPath | Points to the device to test. |
ZIP_API bool ZipPlatform::GetFileAttr | ( | LPCTSTR | lpFileName, |
DWORD & | uAttr | ||
) |
Returns the file attributes.
ZIP_API bool ZipPlatform::GetFileSize | ( | LPCTSTR | lpszFileName, |
ZIP_SIZE_TYPE & | dSize | ||
) |
Returns the file size.
ZIP_API intptr_t ZipPlatform::GetFileSystemHandle | ( | int | iDes | ) |
Returns the underlying system handle.
ZIP_API bool ZipPlatform::GetFileTimes | ( | LPCTSTR | lpFileName, |
time_t * | tModificationTime, | ||
time_t * | tCreationTime = NULL , |
||
time_t * | tLastAccessTime = NULL |
||
) |
Retrieves file times.
ZIP_API bool ZipPlatform::GetSystemCaseSensitivity | ( | ) |
Returns the default case-sensitivity for the current file system.
true
, if the system is case-sensitive; false
otherwise. ZIP_API int ZipPlatform::GetSystemID | ( | ) |
Returns the current system identifier.
ZIP_API CZipString ZipPlatform::GetTmpFileName | ( | LPCTSTR | lpszPath = NULL , |
ZIP_SIZE_TYPE | uSizeNeeded = 0 |
||
) |
Returns the name of a temporary file ensuring there is enough free space in the destination directory.
lpszPath | The path to the directory to initially create the file in. |
uSizeNeeded | The requested free space size in bytes. If set to 0 , the space availability is not checked. |
ZIP_API bool ZipPlatform::IsDirectory | ( | DWORD | uAttr | ) |
Checks if the given attributes represent a directory.
uAttr | The attributes to test. |
true
if the attributes represent a directory; false
otherwise. ZIP_API bool ZipPlatform::IsDriveRemovable | ( | LPCTSTR | lpszFilePath | ) |
Checks if the given drive is removable.
lpszFilePath | The path to the drive. May point to a file path or a directory on the drive. |
true
. if the drive is removable; false
otherwise.true
. ZIP_API int ZipPlatform::MultiByteToWide | ( | const CZipAutoBuffer & | szIn, |
CZipString & | szOut, | ||
UINT | uCodePage | ||
) |
Converts a multi-byte character string to a wide character string.
szIn | The multi-byte character string to convert. Should not contain the terminating NULL character. |
szOut | Receives the converted string. |
uCodePage | The code page used in conversion. |
NULL
character) or -1
when the function did not succeed.ZIP_API int ZipPlatform::MultiByteToWide | ( | const char * | szIn, |
int | iInSize, | ||
CZipString & | szOut, | ||
UINT | uCodePage | ||
) |
Converts a multi-byte character string to a wide character string.
szIn | The multi-byte character string to convert. Should contain the terminating NULL character or the size should be specified (not less than 0) |
iInSize | The size of the string to convert or less than to if the size should be determined (the szIn string needs to include the terminating NULL character). |
szOut | Receives the converted string. |
uCodePage | The code page used in conversion. |
NULL
character) or -1
when the function did not succeed.ZIP_API int ZipPlatform::OpenFile | ( | LPCTSTR | lpszFileName, |
UINT | iMode, | ||
int | iShareMode | ||
) |
Opens the file.
ZIP_API bool ZipPlatform::RemoveFile | ( | LPCTSTR | lpszFileName, |
bool | bThrow = true , |
||
int | iMode = fomRegular |
||
) |
Removes a file.
ZIP_API bool ZipPlatform::RenameFile | ( | LPCTSTR | lpszOldName, |
LPCTSTR | lpszNewName, | ||
bool | bThrow = true |
||
) |
Renames a file.
ZIP_API bool ZipPlatform::SetFileAttr | ( | LPCTSTR | lpFileName, |
DWORD | uAttr | ||
) |
Sets the file attributes.
ZIP_API bool ZipPlatform::SetFileAttr | ( | HANDLE | handle, |
DWORD | uAttr | ||
) |
Sets the file attributes.
ZIP_API bool ZipPlatform::SetFileTimes | ( | LPCTSTR | lpFileName, |
const time_t * | tModificationTime, | ||
const time_t * | tCreationTime = NULL , |
||
const time_t * | tLastAccessTime = NULL |
||
) |
Sets file times.
ZIP_API bool ZipPlatform::SetFileTimes | ( | HANDLE | handle, |
const time_t * | tModificationTime, | ||
const time_t * | tCreationTime = NULL , |
||
const time_t * | tLastAccessTime = NULL |
||
) |
Set file times.
ZIP_API bool ZipPlatform::SetVolLabel | ( | LPCTSTR | lpszPath, |
LPCTSTR | lpszLabel | ||
) |
Sets a label on a removable device. lpszPath
may point to a file on the device.
ZIP_API bool ZipPlatform::TruncateFile | ( | int | iDes, |
ULONGLONG | uSize | ||
) |
Truncates the file.
ZIP_API int ZipPlatform::WideToMultiByte | ( | LPCWSTR | lpszIn, |
CZipAutoBuffer & | szOut, | ||
UINT | uCodePage | ||
) |
Converts a wide character string to a multi-byte character string.
lpszIn | The wide character string to convert. |
szOut | The buffer to receive the converted string. Does not contain the terminating NULL character. |
uCodePage | The code page used in conversion. |
-1
when not succeeded.ZIP_API int ZipPlatform::WideToMultiByte | ( | LPCWSTR | lpszIn, |
CZipAutoBuffer & | szOut, | ||
bool | bAddNull, | ||
UINT | uCodePage | ||
) |
Converts a wide character string to a multi-byte character string.
lpszIn | The wide character string to convert. |
szOut | The buffer to receive the converted string. It contains the terminating NULL character depending on the bAddNull parameter. |
bAddNull | If true , adds the terminating NULL character to the end of the resulting string; false otherwise. |
uCodePage | The code page used in conversion. |
-1
when not succeeded.