23 #include <sys/types.h>
25 #include <tqdatetime.h>
27 #include <tqstringlist.h>
54 KTar(
const TQString& filename,
const TQString & mimetype = TQString::null );
64 KTar( TQIODevice * dev );
85 void setOrigFileName(
const TQCString & fileName );
88 bool writeSymLink(
const TQString &name,
const TQString &target,
89 const TQString &user,
const TQString &group,
90 mode_t perm, time_t atime, time_t mtime, time_t ctime);
91 virtual bool writeDir(
const TQString& name,
const TQString& user,
const TQString& group );
93 bool writeDir(
const TQString& name,
const TQString& user,
const TQString& group,
94 mode_t perm, time_t atime, time_t mtime, time_t ctime );
95 virtual bool prepareWriting(
const TQString& name,
const TQString& user,
const TQString& group, uint size );
98 const TQString& group, uint size, mode_t perm,
99 time_t atime, time_t mtime, time_t ctime );
116 void prepareDevice(
const TQString & filename,
const TQString & mimetype,
bool forced =
false );
125 void fillBuffer(
char * buffer,
const char * mode,
int size, time_t mtime,
126 char typeflag,
const char * uname,
const char * gname );
139 void writeLonglink(
char *buffer,
const TQCString &name,
char typeflag,
140 const char *uname,
const char *gname);
142 TQ_LONG readRawHeader(
char *buffer);
143 bool readLonglink(
char *buffer,TQCString &longlink);
144 TQ_LONG readHeader(
char *buffer,TQString &name,TQString &symlink);
148 virtual void virtual_hook(
int id,
void* data );
149 bool prepareWriting_impl(
const TQString& name,
const TQString& user,
150 const TQString& group, uint size, mode_t perm,
151 time_t atime, time_t mtime, time_t ctime);
152 bool writeDir_impl(
const TQString& name,
const TQString& user,
153 const TQString& group, mode_t perm,
154 time_t atime, time_t mtime, time_t ctime );
155 bool writeSymLink_impl(
const TQString &name,
const TQString &target,
156 const TQString &user,
const TQString &group,
157 mode_t perm, time_t atime, time_t mtime, time_t ctime);
167 #define KTarEntry KArchiveEntry
168 #define KTarFile KArchiveFile
169 #define KTarDirectory KArchiveDirectory
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 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...
A class for reading / writing (optionally compressed) tar archives.
TQString fileName()
The name of the tar file, as passed to the constructor Null if you used the TQIODevice constructor.