Solid File System

Virtual file system enigne that can be embedded into your software.

SolFSStorage.SetFileCompression method

Filter:

Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    

Overview

Compresses or decompresses the file.

Declaration

[Pascal]
    procedure SetFileCompression(const FileName: TSolFSString; Compression: TSolFSCompression; CompressionLevel : LongWord; PagesPerCluster : LongWord; Password: String);

[Plain C]
    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 TSolFSString FileName, TSolFSCompression Compression, unsigned long CompressionLevel, unsigned long PagesPerCluster, TSolFSString 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)

[Java]
    void setFileCompression( String fileName, SolFSCompression compression, long compressionLevel, long pagesPerCluster, String password)

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).
  • [Plain C] Storage - handle to the storage returned by Create or Open function.
  • [Plain C] PasswordLen - length of the password.

Values of SolFSCompression

[Plain C]  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.

See also

GetFileCompression

Back to top