Gzip Unicode C Reference Documentation

Gzip

Current Version: 11.4.0

This class provides functionality for working with GZIP compression in both file-based and in-memory scenarios. It supports compressing and decompressing:

  • Files (.gz, .tar.gz)
  • Strings (with charset conversion)
  • Binary data (byte[], BinData)
  • Encoded data (Base64, Hex, etc.)

It also allows embedding metadata such as filenames, timestamps, and comments within the GZIP format.

For an extended overview, see Gzip Class Overview.

Create/Dispose

HCkGzipW instance = CkGzipW_Create();
// ...
CkGzipW_Dispose(instance);
HCkGzipW CkGzipW_Create(void);

Creates an instance of the HCkGzipW object and returns a handle ("void *" pointer). The handle is passed in the 1st argument for the functions listed on this page.

void CkGzipW_Dispose(HCkGzipW handle);

Objects created by calling CkGzipW_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkGzipW_Dispose.

Callback Functions

Callback Functions introduced in Chilkat v9.5.0.56
void CkGzipW_setAbortCheck(HCkGzipW cHandle, BOOL (*fnAbortCheck)(void));

Provides the opportunity for a method call to be aborted. If TRUE is returned, the operation in progress is aborted. Return FALSE to allow the current method call to continue. This callback function is called periodically based on the value of the HeartbeatMs property. (If HeartbeatMs is 0, then no callbacks are made.) As an example, to make 5 AbortCheck callbacks per second, set the HeartbeatMs property equal to 200.

void CkGzipW_setPercentDone(HCkGzipW cHandle, BOOL (*fnPercentDone)(int pctDone));

Provides the percentage completed for any method that involves network communications or time-consuming processing (assuming it is a method where a percentage completion can be measured). This callback is only called when it is possible to know a percentage completion, and when it makes sense to express the operation as a percentage completed. The pctDone argument will have a value from 1 to 100. For methods that complete very quickly, the number of PercentDone callbacks will vary, but the final callback should have a value of 100. For long running operations, no more than one callback per percentage point will occur (for example: 1, 2, 3, ... 98, 99, 100).

This callback counts as an AbortCheck callback, and takes the place of the AbortCheck event when it fires.

The return value indicates whether the method call should be aborted, or whether it should proceed. Return TRUE to abort, and FALSE to proceed.

void CkGzipW_setProgressInfo(HCkGzipW cHandle, void (*fnProgressInfo)(const wchar_t *name, const wchar_t *value));

This is a general callback that provides name/value information about what is happening at certain points during a method call. To see the information provided in ProgressInfo callbacks, if any, write code to handle this event and log the name/value pairs. Most are self-explanatory.

void CkGzipW_setTaskCompleted(HCkGzipW cHandle, void (*fnTaskCompleted)(HCkTaskW hTask));

Called in the background thread when an asynchronous task completes. (Note: When an async method is running, all callbacks are in the background thread.)

Properties

AbortCurrent
BOOL CkGzipW_getAbortCurrent(HCkGzipW cHandle);
void CkGzipW_putAbortCurrent(HCkGzipW cHandle, BOOL newVal);
Introduced in version 9.5.0.58

Set this property to TRUE to request that the currently running operation be aborted. This is useful for long-running operations such as large file compression or decompression. Methods that complete quickly are generally not affected.

If no method is currently running, the property is automatically reset to FALSE when the next method begins. After an abort occurs, it is also reset to FALSE. Both synchronous and asynchronous operations can be aborted. For synchronous calls, another thread must set this property.

top
Comment
void CkGzipW_getComment(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putComment(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_comment(HCkGzipW cHandle);

An optional comment to embed in the Gzip file when a Compress* method is called.

top
CompressionLevel
int CkGzipW_getCompressionLevel(HCkGzipW cHandle);
void CkGzipW_putCompressionLevel(HCkGzipW cHandle, int newVal);
Introduced in version 9.5.0.50

Controls the compression level used when creating Gzip data. The value can range from 0 to 9.

  • 0 = no compression
  • 9 = maximum compression

The default value is 6, which is a typical balance between compression size and speed. Higher levels may take significantly more CPU time while producing only slightly smaller output, depending on the data.

top
DebugLogFilePath
void CkGzipW_getDebugLogFilePath(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putDebugLogFilePath(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_debugLogFilePath(HCkGzipW cHandle);

If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.

Enabling the VerboseLogging property provides more detailed information. This property is mainly used for debugging rare instances where a Chilkat method call causes a hang or crash, which should generally not happen.

Possible causes of hangs include:

  • A timeout property set to 0, indicating an infinite timeout.
  • A hang occurring within an event callback in the application code.
  • An internal bug in the Chilkat code causing the hang.

More Information and Examples
top
Filename
void CkGzipW_getFilename(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putFilename(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_filename(HCkGzipW cHandle);

The filename to embed in the Gzip file when a Compress* method is called. Some Gzip extraction tools use this embedded filename as the default output filename.

top
HeartbeatMs
int CkGzipW_getHeartbeatMs(HCkGzipW cHandle);
void CkGzipW_putHeartbeatMs(HCkGzipW cHandle, int newVal);

Specifies the interval, in milliseconds, between AbortCheck event callbacks. These callbacks allow an application to cancel certain long-running operations before they finish.

The default value is 0, which means no AbortCheck callbacks are triggered.

More Information and Examples
top
LastErrorHtml
void CkGzipW_getLastErrorHtml(HCkGzipW cHandle, HCkString retval);
const wchar_t *CkGzipW_lastErrorHtml(HCkGzipW cHandle);

Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastErrorText
void CkGzipW_getLastErrorText(HCkGzipW cHandle, HCkString retval);
const wchar_t *CkGzipW_lastErrorText(HCkGzipW cHandle);

Provides plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastErrorXml
void CkGzipW_getLastErrorXml(HCkGzipW cHandle, HCkString retval);
const wchar_t *CkGzipW_lastErrorXml(HCkGzipW cHandle);

Provides XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastMethodSuccess
BOOL CkGzipW_getLastMethodSuccess(HCkGzipW cHandle);
void CkGzipW_putLastMethodSuccess(HCkGzipW cHandle, BOOL newVal);

Indicates the success or failure of the most recent method call: TRUE means success, FALSE means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.

top
LastModStr
void CkGzipW_getLastModStr(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putLastModStr(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_lastModStr(HCkGzipW cHandle);

Specifies the last-modified date/time to embed in the Gzip file when a Compress* method is called.

The value must be provided as an RFC 822 formatted date/time string.

Example:

Tue, 15 Nov 1994 12:45:26 GMT

If this property is not set, the current system date/time is used automatically.

top
UseCurrentDate
BOOL CkGzipW_getUseCurrentDate(HCkGzipW cHandle);
void CkGzipW_putUseCurrentDate(HCkGzipW cHandle, BOOL newVal);

Controls the last-modified date/time assigned to files created by Uncompress* methods.

When set to TRUE, the extracted file uses the current date/time instead of the date/time stored in the Gzip data.

top
VerboseLogging
BOOL CkGzipW_getVerboseLogging(HCkGzipW cHandle);
void CkGzipW_putVerboseLogging(HCkGzipW cHandle, BOOL newVal);

If set to TRUE, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is FALSE. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
void CkGzipW_getVersion(HCkGzipW cHandle, HCkString retval);
const wchar_t *CkGzipW_version(HCkGzipW cHandle);

Version of the component/library, such as "10.1.0"

More Information and Examples
top

Methods

CompressBd
BOOL CkGzipW_CompressBd(HCkGzipW cHandle, HCkBinDataW binDat);
Introduced in version 9.5.0.67

Compresses the contents of a BinData object in place, replacing the original data with Gzip-compressed data.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
CompressBdAsync (1)
HCkTaskW CkGzipW_CompressBdAsync(HCkGzipW cHandle, HCkBinDataW binDat);
Introduced in version 9.5.0.67

Creates an asynchronous task to call the CompressBd method with the arguments provided.

Returns NULL on failure

top
CompressFile
BOOL CkGzipW_CompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);

Compresses a file and writes the result as a Gzip file, typically with a .gz extension.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
CompressFileAsync (1)
HCkTaskW CkGzipW_CompressFileAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);

Creates an asynchronous task to call the CompressFile method with the arguments provided.

Returns NULL on failure

top
CompressFile2
BOOL CkGzipW_CompressFile2(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *embeddedFilename, const wchar_t *destPath);

Compresses a file and writes the result as a Gzip file, while allowing a different filename to be embedded inside the Gzip data.

The inFilename parameter is the actual file on disk. The srcPath parameter is the filename stored in the Gzip header and may be used by extraction tools as the output filename.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
CompressFile2Async (1)
HCkTaskW CkGzipW_CompressFile2Async(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *embeddedFilename, const wchar_t *destPath);

Creates an asynchronous task to call the CompressFile2 method with the arguments provided.

Returns NULL on failure

top
CompressFileBd
BOOL CkGzipW_CompressFileBd(HCkGzipW cHandle, const wchar_t *filePath, HCkBinDataW bd);
Introduced in version 11.0.0

Compresses a file and stores the resulting Gzip data in a BinData object.

The compressed output is held in memory. The maximum compressed size is 4 GB.

Returns TRUE for success, FALSE for failure.

top
CompressFileBdAsync (1)
HCkTaskW CkGzipW_CompressFileBdAsync(HCkGzipW cHandle, const wchar_t *filePath, HCkBinDataW bd);
Introduced in version 11.0.0

Creates an asynchronous task to call the CompressFileBd method with the arguments provided.

Returns NULL on failure

top
CompressSb
BOOL CkGzipW_CompressSb(HCkGzipW cHandle, HCkStringBuilderW sb, const wchar_t *charset, HCkBinDataW bd);
Introduced in version 11.0.0

Compresses the text contained in a StringBuilder and writes the Gzip-compressed result to a BinData object.

Before compression, the string is converted to bytes using the specified character set, such as utf-8, iso-8859-1, or shift_JIS.

Returns TRUE for success, FALSE for failure.

top
CompressSbAsync (1)
HCkTaskW CkGzipW_CompressSbAsync(HCkGzipW cHandle, HCkStringBuilderW sb, const wchar_t *charset, HCkBinDataW bd);
Introduced in version 11.0.0

Creates an asynchronous task to call the CompressSb method with the arguments provided.

Returns NULL on failure

top
CompressStringENC
BOOL CkGzipW_CompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr);
const wchar_t *CkGzipW_compressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);

Compresses a string and returns the Gzip-compressed data as an encoded string.

The input string is first converted to bytes using the specified character set. The compressed binary data is then encoded using the requested encoding, such as base64, hex, url, base32, or quoted-printable.

Returns TRUE for success, FALSE for failure.

top
CompressStringToFile
BOOL CkGzipW_CompressStringToFile(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const wchar_t *destPath);

Compresses a string and writes the resulting Gzip data to a file.

The string is first converted to bytes using the character set specified by destCharset.

Returns TRUE for success, FALSE for failure.

top
CompressStringToFileAsync (1)
HCkTaskW CkGzipW_CompressStringToFileAsync(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const wchar_t *destPath);

Creates an asynchronous task to call the CompressStringToFile method with the arguments provided.

Returns NULL on failure

top
ExamineFile
BOOL CkGzipW_ExamineFile(HCkGzipW cHandle, const wchar_t *filePath);

Checks whether the specified file contains Gzip-formatted data.

Returns TRUE if the file is in Gzip format, or FALSE otherwise.

More Information and Examples
top
IsGzip
BOOL CkGzipW_IsGzip(HCkGzipW cHandle, HCkBinDataW bd);
Introduced in version 11.0.0

Checks whether the data contained in a BinData object is in Gzip format.

Returns TRUE if the data is Gzip-formatted, or FALSE otherwise.

top
LoadTaskCaller
BOOL CkGzipW_LoadTaskCaller(HCkGzipW cHandle, HCkTaskW task);
Introduced in version 9.5.0.80

Loads the caller of the task's async method.

Returns TRUE for success, FALSE for failure.

top
SetDt
BOOL CkGzipW_SetDt(HCkGzipW cHandle, HCkDateTimeW dt);

Sets the last-modified date/time to embed in the Gzip file when a Compress* method is called.

If no date/time is explicitly set, the current system date/time is used.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
SetExtraData
BOOL CkGzipW_SetExtraData(HCkGzipW cHandle, const wchar_t *encodedData, const wchar_t *encoding);
Introduced in version 11.0.0

Sets optional extra binary data to include in the Gzip header when a Compress* method is called.

The data is passed as an encoded string. Supported encodings include base64, hex, ascii, and many others.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
UncompressBd
BOOL CkGzipW_UncompressBd(HCkGzipW cHandle, HCkBinDataW binDat);
Introduced in version 9.5.0.67

Decompresses Gzip data contained in a BinData object in place, replacing the compressed data with the uncompressed data.

Returns TRUE for success, FALSE for failure.

top
UncompressBdAsync (1)
HCkTaskW CkGzipW_UncompressBdAsync(HCkGzipW cHandle, HCkBinDataW binDat);
Introduced in version 9.5.0.67

Creates an asynchronous task to call the UncompressBd method with the arguments provided.

Returns NULL on failure

top
UncompressBdToFile
BOOL CkGzipW_UncompressBdToFile(HCkGzipW cHandle, HCkBinDataW bd, const wchar_t *filePath);
Introduced in version 11.0.0

Decompresses Gzip data stored in a BinData object and writes the result to a file.

Returns TRUE for success, FALSE for failure.

top
UncompressBdToFileAsync (1)
HCkTaskW CkGzipW_UncompressBdToFileAsync(HCkGzipW cHandle, HCkBinDataW bd, const wchar_t *filePath);
Introduced in version 11.0.0

Creates an asynchronous task to call the UncompressBdToFile method with the arguments provided.

Returns NULL on failure

top
UncompressFile
BOOL CkGzipW_UncompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);

Decompresses a Gzip file and writes the result to the specified output path.

The output filename is provided by the caller. The filename embedded in the Gzip data is not used.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
UncompressFileAsync (1)
HCkTaskW CkGzipW_UncompressFileAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);

Creates an asynchronous task to call the UncompressFile method with the arguments provided.

Returns NULL on failure

top
UncompressFileToString
BOOL CkGzipW_UncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset, const wchar_t *outStr);
const wchar_t *CkGzipW_uncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset);

Decompresses a Gzip file that contains text and returns the uncompressed text as a string.

The charset parameter specifies the character encoding of the uncompressed text, such as utf-8, iso-8859-1, windows-1252, shift_JIS, big5, etc.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
UncompressFileToStringAsync (1)
HCkTaskW CkGzipW_UncompressFileToStringAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset);

Creates an asynchronous task to call the UncompressFileToString method with the arguments provided.

Returns NULL on failure

top
UncompressStringENC
BOOL CkGzipW_UncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr);
const wchar_t *CkGzipW_uncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);

Decompresses Gzip data provided as an encoded string and returns the uncompressed result as text.

The input string is first decoded using the specified encoding, such as base64, hex, url, base32, quoted-printable, etc. The decoded Gzip data is then decompressed and converted to text using the specified character set.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
UnTarGz
BOOL CkGzipW_UnTarGz(HCkGzipW cHandle, const wchar_t *gzPath, const wchar_t *destDir, BOOL bNoAbsolute);

Extracts a .tar.gz archive to a directory.

The Gzip decompression and TAR extraction are performed in streaming mode. No temporary files are created, and memory usage remains small and constant.

If bNoAbsolute is TRUE, absolute paths in the TAR archive are not allowed. This helps protect against extracting files to unsafe locations, such as system directories.

Returns TRUE for success, FALSE for failure.

top
UnTarGzAsync (1)
HCkTaskW CkGzipW_UnTarGzAsync(HCkGzipW cHandle, const wchar_t *gzPath, const wchar_t *destDir, BOOL bNoAbsolute);

Creates an asynchronous task to call the UnTarGz method with the arguments provided.

Returns NULL on failure

top
XfdlToXml
BOOL CkGzipW_XfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData, const wchar_t *outStr);
const wchar_t *CkGzipW_xfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData);

Converts base64-encoded, Gzip-compressed XFDL data to XML text.

The input contains base64 data. The method decodes it, decompresses the Gzip data, and returns the resulting XML string.

XFDL (Extensible Forms Description Language) is an XML-based format used to define secure, interactive electronic forms—often including digital signatures and integrity protections—commonly used in government and enterprise applications.

Returns TRUE for success, FALSE for failure.

top

Deprecated

CompressFileToMem Deprecated
BOOL CkGzipW_CompressFileToMem(HCkGzipW cHandle, const wchar_t *inFilename, const unsigned char * outData);

Compresses a file and returns the resulting Gzip data as a byte array.

The compressed output is held in memory and has a maximum size limit of 4 GB.

Returns TRUE for success, FALSE for failure.

top
CompressFileToMemAsync Deprecated (1)
HCkTaskW CkGzipW_CompressFileToMemAsync(HCkGzipW cHandle, const wchar_t *inFilename);

Creates an asynchronous task to call the CompressFileToMem method with the arguments provided.

Returns NULL on failure

top
CompressMemory Deprecated
BOOL CkGzipW_CompressMemory(HCkGzipW cHandle, HCkByteData inData, const unsigned char * outData);

Compresses a byte array and returns the result as an in-memory Gzip image.

The uncompressed input data must not exceed 4 GB.

Returns TRUE for success, FALSE for failure.

top
CompressMemoryAsync Deprecated (1)
HCkTaskW CkGzipW_CompressMemoryAsync(HCkGzipW cHandle, HCkByteData inData);

Creates an asynchronous task to call the CompressMemory method with the arguments provided.

Returns NULL on failure

top
CompressMemToFile Deprecated
BOOL CkGzipW_CompressMemToFile(HCkGzipW cHandle, HCkByteData inData, const wchar_t *destPath);

Compresses a byte array and writes the resulting Gzip data to a file.

Returns TRUE for success, FALSE for failure.

top
CompressMemToFileAsync Deprecated (1)
HCkTaskW CkGzipW_CompressMemToFileAsync(HCkGzipW cHandle, HCkByteData inData, const wchar_t *destPath);

Creates an asynchronous task to call the CompressMemToFile method with the arguments provided.

Returns NULL on failure

top
CompressString Deprecated
BOOL CkGzipW_CompressString(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const unsigned char * outBytes);

Compresses a string and returns the Gzip-compressed data as a byte array.

The string is first converted to bytes using the character set specified by destCharset. Common values include utf-8, iso-8859-1, and shift_JIS.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
CompressStringAsync Deprecated (1)
HCkTaskW CkGzipW_CompressStringAsync(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset);

Creates an asynchronous task to call the CompressString method with the arguments provided.

Returns NULL on failure

top
Decode Deprecated
BOOL CkGzipW_Decode(HCkGzipW cHandle, const wchar_t *encodedStr, const wchar_t *encoding, const unsigned char * outBytes);
This method is deprecated.

Decodes an encoded string and returns the original data. The encoding mode is determined by encoding. It may be base64, hex, quoted-printable, or url.

Returns TRUE for success, FALSE for failure.

top
DeflateStringENC
BOOL CkGzipW_DeflateStringENC(HCkGzipW cHandle, const wchar_t *inString, const wchar_t *charsetName, const wchar_t *outputEncoding, const wchar_t *outStr);
const wchar_t *CkGzipW_deflateStringENC(HCkGzipW cHandle, const wchar_t *inString, const wchar_t *charsetName, const wchar_t *outputEncoding);
This method is deprecated.

Compresses a string using the raw deflate algorithm and returns the compressed data as an encoded string.

The input string is first converted to bytes using the specified character set. The compressed binary data is then encoded using the requested output encoding, such as hex, base64, url, or quoted-printable.

Important: This method produces raw deflate-compressed data, not Gzip-format data. Use the Compress* methods when Gzip format output is required.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
Encode Deprecated
BOOL CkGzipW_Encode(HCkGzipW cHandle, HCkByteData byteData, const wchar_t *encoding, const wchar_t *outStr);
const wchar_t *CkGzipW_encode(HCkGzipW cHandle, HCkByteData byteData, const wchar_t *encoding);
This method is deprecated.

Encodes binary data to a printable string. The encoding mode is determined by encoding. It may be base64, hex, quoted-printable, or url.

Returns TRUE for success, FALSE for failure.

top
ExamineMemory Deprecated
BOOL CkGzipW_ExamineMemory(HCkGzipW cHandle, HCkByteData inGzData);

Checks whether the provided byte array contains Gzip-formatted data.

Returns TRUE if the data is in Gzip format, or FALSE otherwise.

top
GetDt
HCkDateTimeW CkGzipW_GetDt(HCkGzipW cHandle);
This method is deprecated.

Applications should instead access the LastModStr property.

Gets the last-modification date/time to be embedded within the .gz.

Returns NULL on failure

top
InflateStringENC
BOOL CkGzipW_InflateStringENC(HCkGzipW cHandle, const wchar_t *inString, const wchar_t *convertFromCharset, const wchar_t *inputEncoding, const wchar_t *outStr);
const wchar_t *CkGzipW_inflateStringENC(HCkGzipW cHandle, const wchar_t *inString, const wchar_t *convertFromCharset, const wchar_t *inputEncoding);
This method is deprecated.

Decompresses data previously compressed with DeflateStringENC.

The input string is first decoded using the specified input encoding, such as hex, base64, url, or quoted-printable. The resulting compressed bytes are then inflated, and the final bytes are converted to a string using the specified character set.

Returns TRUE for success, FALSE for failure.

top
ReadFile Deprecated
BOOL CkGzipW_ReadFile(HCkGzipW cHandle, const wchar_t *path, const unsigned char * outBytes);
This method is deprecated.

Reads a binary file into memory and returns the byte array. Note: This method does not parse a Gzip, it is only a convenience method for reading a binary file into memory.

Returns TRUE for success, FALSE for failure.

top
UncompressFileToMem Deprecated
BOOL CkGzipW_UncompressFileToMem(HCkGzipW cHandle, const wchar_t *srcPath, const unsigned char * outData);

Decompresses a Gzip file and returns the uncompressed data as a byte array.

The uncompressed output is held in memory and must not exceed 4 GB.

Returns TRUE for success, FALSE for failure.

top
UncompressFileToMemAsync Deprecated (1)
HCkTaskW CkGzipW_UncompressFileToMemAsync(HCkGzipW cHandle, const wchar_t *srcPath);

Creates an asynchronous task to call the UncompressFileToMem method with the arguments provided.

Returns NULL on failure

top
UncompressMemory Deprecated
BOOL CkGzipW_UncompressMemory(HCkGzipW cHandle, HCkByteData inData, const unsigned char * outData);

Decompresses an in-memory Gzip image and returns the uncompressed data as a byte array.

The uncompressed output is held in memory and must not exceed 4 GB.

Returns TRUE for success, FALSE for failure.

top
UncompressMemoryAsync Deprecated (1)
HCkTaskW CkGzipW_UncompressMemoryAsync(HCkGzipW cHandle, HCkByteData inData);

Creates an asynchronous task to call the UncompressMemory method with the arguments provided.

Returns NULL on failure

top
UncompressMemToFile Deprecated
BOOL CkGzipW_UncompressMemToFile(HCkGzipW cHandle, HCkByteData inData, const wchar_t *destPath);

Decompresses an in-memory Gzip image and writes the uncompressed data to a file.

Returns TRUE for success, FALSE for failure.

top
UncompressMemToFileAsync Deprecated (1)
HCkTaskW CkGzipW_UncompressMemToFileAsync(HCkGzipW cHandle, HCkByteData inData, const wchar_t *destPath);

Creates an asynchronous task to call the UncompressMemToFile method with the arguments provided.

Returns NULL on failure

top
UncompressString Deprecated
BOOL CkGzipW_UncompressString(HCkGzipW cHandle, HCkByteData inData, const wchar_t *inCharset, const wchar_t *outStr);
const wchar_t *CkGzipW_uncompressString(HCkGzipW cHandle, HCkByteData inData, const wchar_t *inCharset);

Decompresses Gzip-compressed data and returns the result as a string.

After decompression, the result is raw binary data (a sequence of bytes). These bytes are then interpreted as text using the specified character set (such as utf-8, iso-8859-1, etc.) to produce the final string.

Internally, Chilkat converts the byte sequence to a string by interpreting the bytes according to the specified character set. For example, if utf-8 is specified, the bytes are treated as the UTF-8 byte representation of text and decoded into the internal string format used by the programming language.

It is important that the character set matches the one originally used when the data was compressed. If the wrong character set is used, the byte-to-text conversion may produce incorrect or unreadable characters.

Returns TRUE for success, FALSE for failure.

More Information and Examples
top
UncompressStringAsync Deprecated (1)
HCkTaskW CkGzipW_UncompressStringAsync(HCkGzipW cHandle, HCkByteData inData, const wchar_t *inCharset);

Creates an asynchronous task to call the UncompressString method with the arguments provided.

Returns NULL on failure

top
WriteFile Deprecated
BOOL CkGzipW_WriteFile(HCkGzipW cHandle, const wchar_t *path, HCkByteData binaryData);
This method is deprecated.

A convenience method for writing a binary byte array to a file.

Returns TRUE for success, FALSE for failure.

top