gzip()

CtrlZlib is a shared library with functions for data compression. It is based on libz (gzip, gunzip). The functiongzip()compresses the content of the parameter source. The result is saved in the parameter target.

Synopsis

bool gzip(blob | string source, blob &target);

Parameters

Parameter Description
source The content to be compressed.
target The compressed content.

Return value

TRUE = Successful

FALSE = Failure

Error

FALSE

Description

The function gzip() compresses the content of the parameter source. The result is saved in the parameter target.

Example

#uses "CtrlZlib"
main()
{
  string inh = "Hello this is a test";
  blob tr;
  gzip(inh, tr);
  DebugN("Compressed content", tr);
  bool retV;
  string t;
  retV = gunzip(tr, t);
  DebugN("Extracted content", t);
}

Assignment

File function

Availability

CTRL