CkZipEntry C++ Class Reference (Visual C++)
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 of this file when Zip 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
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) a file on disk referenced by Zip.NET and to be added to the Zip, (1) an entry in an existing Zip file, 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 the Zip entry 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);
Append text or binary data to a file within a Zip archive
bool AppendData(const CkString & sdata);
Append text or binary data to a file within a Zip archive
bool Copy(CkByteData & bdata);
Returns the compressed data as a byte array.
bool CopyToBase64(CkString & str);
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 & str);
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 & bdata);
Inflate a file within a Zip directly into memory.
bool InflateToHandle(HANDLE handle);
To be documented soon...
bool InflateToString(bool addCR, CkString & str);
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 & str);
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
bool ReplaceData(const CkByteData & bdata);
Replace the contents of a file within a Zip archive
bool ReplaceData(const CkString & sdata);
Replace the contents of a file within a Zip archive
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.
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.
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.
const char * fileName();
The file name of the Zip entry.
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.
const char * inflateToString2();
Unzip a file directly into memory as a string, and leave line-endings unmodified.
const char * lastErrorHtml();
Error information in HTML format for the last method called.
const char * lastErrorText();
Error information in plain-text format for the last method called.
const char * lastErrorXml();
Error information in XML format for the last method called.
|