SolFSStorage.SetFileCompression method
Filter:
Pascal DLL C++ (DLL/Lib) C++ (VCL) C++ (.NET) C# VB.NETOverview
Compresses or decompresses the file.
Declaration
[Pascal]
procedure SetFileCompression(const FileName: WideString;
Compression: TSolFSCompression;
CompressionLevel : LongWord;
PagesPerCluster : LongWord;
Password: String);
[DLL]
long _stdcall StorageSetFileCompression(unsigned long Storage, const wchar_t* FileName,
unsigned long Compression,
unsigned long CompressionLevel,
unsigned long PagesPerCluster,
wchar_t* Password,
unsigned long PasswordLen);
[C++ (DLL/Lib)]
void SetFileCompression(const unsigned short * FileName,
SolFSCompression Compression,
unsigned long CompressionLevel,
unsigned long PagesPerCluster,
unsigned short * Password);
[C++ (VCL)]
void __fastcall SetFileCompression(const WideString FileName,
TSolFSCompression Compression,
unsigned long CompressionLevel,
unsigned long PagesPerCluster,
WideString Password);
[C++ (.NET)]
void SetFileCompression(
String *fileName,
SolFSCompression Compression,
unsigned long CompressionLevel,
unsigned long PagesPerCluster,
String *password)
[C#]
void SetFileCompression(
String fileName,
SolFSCompression compression,
uint compressionLevel,
uint pagesPerCluster,
String password)
[VB.NET]
Sub SetFileCompression(ByVal fileName As String,
ByVal compression As SolFSCompression,
ByVal compressionLevel As System.UInt32,
ByVal pagesPerCluster As System.UInt32,
ByVal password As String)
Parameters
- FileName - the full file name in the storage
- Compression - use this parameter to set Compression mode.
- CompressionLevel - compression level. Level value of 0 means "default" value. Other values depend on compression method. For ZLib the values are 1 (faster, less effective) to 9 (slower, most effective).
- PagesPerCluster - the number of pages compressed as a single entity.
- Password - the password used to re-encrypt the file (if it is encrypted).
Values of SolFSCompression
[Pascal] [DLL] [C++ (VCL)] [C++ (.NET)] [C#] [VB.NET] [ActiveX] [VB]
Value
Meaning
crNoCompression
0
Compression is not used.
crDefault
1
Default compression (ZLib).
crCustom
2
Custom compression using callback functions (events).
crZlib
3
Zlib compression.
crRLE
4
RLE compression.
[DLL] Return values
0 if the function succeeded or one of Error codes if the function failed.
Description
Use SetFileCompression to compress or decompress the file or change compression mode. If the file is encrypted, you need to specify the password so that the file is decrypted, re-compressed and then encrypted back using the same password.
