CkZipEntry C++ Class Reference
CkZipEntry
Represents a single file or directory entry within a Chilkat Zip object.
Properties
void get_Comment(CkString &str); void put_Comment(const char *pStr);
The comment stored within the Zip for this entry.
unsigned long get_CompressedLength(void);
The size in bytes of this entry's file data when compression is applied
__int64 get_CompressedLength64(void);
The size in bytes of this entry's file data when compression is applied
long get_CompressionLevel(void); void put_CompressionLevel(long newVal);
The compression level. 0 = no compression, while 9 = maximum compression. The default is 6.
long get_CompressionMethod(void); void put_CompressionMethod(long newVal);
Set to 0 for no compression, or 8 for the Deflate algorithm. The Deflate algorithm is the default algorithm of the most popular Zip utility programs, such as WinZip
int get_Crc(void);
The CRC for the zip entry.
long get_EntryID(void);
The unique ID assigned by Zip.NET while the object is instantiated in memory.
long get_EntryType(void);
Indicates the origin of the entry. There are three possible values: (0) an entry in an existing Zip file, (1) a file on disk referenced by Zip.NET and to be added to the Zip, and (2) an entry created directly from data in memory.
void get_FileDateTime(SYSTEMTIME &sysTime); void put_FileDateTime(const SYSTEMTIME &sysTime);
The last-modified time of the Zip entry.
void get_FileName(CkString &str); void put_FileName(const char *pStr);
The file name of the Zip entry.
bool get_IsDirectory(void);
True if the Zip entry is a directory, false if it is a file.
void LastErrorHtml(CkString &str);
Error information in HTML format for the last method called.
void LastErrorText(CkString &str);
Error information in plain-text format for the last method called.
void LastErrorXml(CkString &str);
Error information in XML format for the last method called.
unsigned long get_UncompressedLength(void);
The size in bytes of this entry's file data when uncompressed.
__int64 get_UncompressedLength64(void);
The size in bytes of this entry's file data when uncompressed.
bool get_Utf8(void) const; void put_Utf8(bool b);
When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.
Methods
bool AppendData(const CkByteData & bdata);
Appends binary data to the zip entry's file contents.
bool AppendStringAnsi(const CkString & sdata);
Appends a ANSI string to the zip entry's file contents.
bool Copy(CkByteData & outData);
Returns the compressed data as a byte array.
bool CopyToBase64(CkString & outStr);
Returns the compressed data as a Base64-encoded string. This data can be re-added to a Zip by calling Zip.AppendBase64. Returns true for success, false for failure.
bool CopyToHex(CkString & outStr);
Returns the compressed data as a hexidecimal encoded string. This data can be re-added to a Zip by calling Zip.AppendHex. Returns true for success, false for failure.
bool Extract(const char * dirPath);
Unzips this entry into the specified base directory. The file is unzipped to the subdirectory according to the relative path stored with the entry in the Zip. Use ExtractInto to unzip into a specific directory regardless of the path information stored in the Zip.
bool ExtractInto(const char * dirPath);
Unzip a file into a specific directory
bool Inflate(CkByteData & outData);
Inflate a file within a Zip directly into memory.
bool InflateToHandle(HANDLE handle);
To be documented soon...
bool InflateToString(bool addCR, CkString & outStr);
Inflate and return the uncompressed data as a string. Line-endings are modified to include or not include carriage-returns based on KeepCR. If KeepCR = False, then bare linefeeds are returned, otherwise CRLFs are returned. Returns true for success, false for failure.
bool InflateToString2(CkString & outStr);
Unzip a file directly into memory as a string, and leave line-endings unmodified. Returns true for success, false for failure.
CkZipEntry * NextEntry();
Return the next entry (file or directory) within the Zip Returns a null reference on failure
bool ReplaceData(const CkByteData & bdata);
Replaces the zip entry's existing contents with new data.
bool ReplaceStringAnsi(const CkString & sdata);
Replaces the zip entry's text content with a new ANSI string.
bool SaveLastError(const char * filename);
Saves the last error information to an XML formatted file.
const char * comment();
The comment stored within the Zip for this entry. Returns a null on failure
const char * copyToBase64();
Returns the compressed data as a Base64-encoded string. This data can be re-added to a Zip by calling Zip.AppendBase64. Returns a null on failure
const char * copyToHex();
Returns the compressed data as a hexidecimal encoded string. This data can be re-added to a Zip by calling Zip.AppendHex. Returns a null on failure
const char * fileName();
The file name of the Zip entry. Returns a null on failure
const char * inflateToString(bool addCR);
Inflate and return the uncompressed data as a string. Line-endings are modified to include or not include carriage-returns based on KeepCR. If KeepCR = False, then bare linefeeds are returned, otherwise CRLFs are returned. Returns a null on failure
const char * inflateToString2();
Unzip a file directly into memory as a string, and leave line-endings unmodified. Returns a null on failure
const char * lastErrorHtml();
Error information in HTML format for the last method called.Returns a null on failure
const char * lastErrorText();
Error information in plain-text format for the last method called.Returns a null on failure
const char * lastErrorXml();
Error information in XML format for the last method called.Returns a null on failure
|