25 #include <sys/types.h>
27 #include <QtCore/QDate>
28 #include <QtCore/QString>
29 #include <QtCore/QStringList>
30 #include <QtCore/QHash>
37 class KArchivePrivate;
72 virtual bool open( QIODevice::OpenMode mode );
94 QIODevice::OpenMode mode()
const;
126 bool addLocalFile(
const QString& fileName,
const QString& destName );
139 bool addLocalDirectory(
const QString& path,
const QString& destName );
141 enum { UnknownTime =
static_cast<time_t
>( -1 ) };
159 mode_t perm = 040755, time_t atime = UnknownTime,
160 time_t mtime = UnknownTime, time_t ctime = UnknownTime );
175 virtual bool writeSymLink(
const QString &name,
const QString &target,
177 mode_t perm = 0120755, time_t atime = UnknownTime,
178 time_t mtime = UnknownTime, time_t ctime = UnknownTime );
200 const char* data,
qint64 size,
201 mode_t perm = 0100644, time_t atime = UnknownTime,
202 time_t mtime = UnknownTime, time_t ctime = UnknownTime );
223 virtual bool prepareWriting(
const QString& name,
const QString& user,
225 mode_t perm = 0100644, time_t atime = UnknownTime,
226 time_t mtime = UnknownTime, time_t ctime = UnknownTime );
231 virtual bool writeData(
const char* data,
qint64 size );
238 virtual bool finishWriting(
qint64 size );
246 virtual bool openArchive( QIODevice::OpenMode mode ) = 0;
252 virtual bool closeArchive() = 0;
279 mode_t perm, time_t atime, time_t mtime, time_t ctime ) = 0;
295 virtual bool doWriteSymLink(
const QString &name,
const QString &target,
297 mode_t perm, time_t atime, time_t mtime, time_t ctime) = 0;
314 virtual bool doPrepareWriting(
const QString& name,
const QString& user,
316 time_t atime, time_t mtime, time_t ctime ) = 0;
325 virtual bool doFinishWriting(
qint64 size ) = 0;
341 virtual bool createDevice( QIODevice::OpenMode mode );
356 virtual void virtual_hook(
int id,
void* data );
358 KArchivePrivate*
const d;
361 class KArchiveEntryPrivate;
410 mode_t permissions()
const;
432 virtual bool isFile()
const;
438 virtual bool isDirectory()
const;
444 virtual void virtual_hook(
int id,
void* data );
446 KArchiveEntryPrivate*
const d;
449 class KArchiveFilePrivate;
502 virtual QByteArray data()
const;
520 virtual bool isFile()
const;
526 void copyTo(
const QString& dest)
const;
531 KArchiveFilePrivate*
const d;
534 class KArchiveDirectoryPrivate;
600 void copyTo(
const QString& dest,
bool recursive =
true)
const;
605 KArchiveDirectoryPrivate*
const d;
virtual bool isDirectory() const
Checks whether the entry is a directory.
KArchive is a base class for reading and writing archives.
int open(const QString &pathname, int flags, mode_t mode)
A base class for entries in an KArchive.
Represents a directory entry in a KArchive.
int access(const QString &path, int mode)
Represents a file entry in a KArchive.
virtual bool isFile() const
Checks whether the entry is a file.
virtual void virtual_hook(int id, void *data)