22 #include <sys/types.h>
24 #include <tqdatetime.h>
26 #include <tqstringlist.h>
28 #include <tqvaluelist.h>
62 KZip(
const TQString& filename );
71 KZip( TQIODevice * dev );
100 void setExtraField( ExtraField ef );
107 ExtraField extraField()
const;
113 DeflateCompression = 1
123 void setCompression( Compression c );
130 Compression compression()
const;
143 virtual bool writeFile(
const TQString& name,
const TQString& user,
const TQString& group, uint size,
const char* data );
154 virtual bool prepareWriting(
const TQString& name,
const TQString& user,
const TQString& group, uint size );
157 bool writeSymLink(
const TQString &name,
const TQString &target,
158 const TQString &user,
const TQString &group,
159 mode_t perm, time_t atime, time_t mtime, time_t ctime);
162 const TQString& group, uint size, mode_t perm,
163 time_t atime, time_t mtime, time_t ctime );
165 bool writeFile(
const TQString& name,
const TQString& user,
const TQString& group,
166 uint size, mode_t perm, time_t atime, time_t mtime,
167 time_t ctime,
const char* data );
174 bool writeData(
const char* data, uint size );
197 virtual bool writeDir(
const TQString& name,
const TQString& user,
const TQString& group);
203 virtual void virtual_hook(
int id,
void* data );
206 bool writeData_impl(
const char* data, uint size );
207 bool prepareWriting_impl(
const TQString& name,
const TQString& user,
208 const TQString& group, uint size, mode_t perm,
209 time_t atime, time_t mtime, time_t ctime);
210 bool writeSymLink_impl(
const TQString &name,
const TQString &target,
211 const TQString &user,
const TQString &group,
212 mode_t perm, time_t atime, time_t mtime, time_t ctime);
231 KZipFileEntry(
KZip* zip,
const TQString& name,
int access,
int date,
232 const TQString& user,
const TQString& group,
const TQString& symlink,
233 const TQString& path, TQ_LONG start, TQ_LONG uncompressedSize,
234 int encoding, TQ_LONG compressedSize) :
236 start, uncompressedSize ),
238 m_compressedSize(compressedSize),
240 m_encoding(encoding),
243 int encoding()
const {
return m_encoding; }
244 TQ_LONG compressedSize()
const {
return m_compressedSize; }
247 void setCompressedSize(TQ_LONG compressedSize) { m_compressedSize = compressedSize; }
250 void setHeaderStart(TQ_LONG headerstart) { m_headerStart = headerstart; }
251 TQ_LONG headerStart()
const {
return m_headerStart; }
254 unsigned long crc32()
const {
return m_crc; }
255 void setCRC32(
unsigned long crc32) { m_crc=crc32; }
258 TQString path()
const {
return m_path; }
264 virtual TQByteArray data()
const;
273 TQIODevice*
device()
const;
277 TQ_LONG m_compressedSize;
278 TQ_LONG m_headerStart;
Represents a file entry in a KArchive.
KArchive is a base class for reading and writing archives.
virtual bool writeDir(const TQString &name, const TQString &user, const TQString &group)=0
If an archive is opened for writing then you can add new directories using this function.
virtual bool closeArchive()=0
Closes the archive.
virtual bool doneWriting(uint size)=0
Call doneWriting after writing the data.
virtual bool openArchive(int mode)=0
Opens an archive for reading or writing.
bool writeData(const char *data, uint size)
Write data into the current file - to be called after calling prepareWriting.
TQIODevice * device() const
The underlying device.
bool writeSymLink(const TQString &name, const TQString &target, const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)
Writes a symbolic link to the archive if the archive must be opened for writing.
virtual bool prepareWriting(const TQString &name, const TQString &user, const TQString &group, uint size)=0
Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() as m...
virtual bool writeFile(const TQString &name, const TQString &user, const TQString &group, uint size, const char *data)
If an archive is opened for writing then you can add a new file using this function.
This class implements a tdeioslave to access zip files from KDE.
TQString fileName()
The name of the zip file, as passed to the constructor.
ExtraField
Describes the contents of the "extra field" for a given file in the Zip archive.
Compression
Describes the compression type for a given file in the Zip archive.
TDEIO_EXPORT SimpleJob * symlink(const TQString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
Create or move a symlink.