KArchive 5.109.0
k7zip.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2011 Mario Bensi <mbensi@ipsquad.net>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#ifndef K7ZIP_H
7#define K7ZIP_H
8
9#include <karchive.h>
10
18class KARCHIVE_EXPORT K7Zip : public KArchive
19{
20 Q_DECLARE_TR_FUNCTIONS(K7Zip)
21
22public:
29 explicit K7Zip(const QString &filename);
30
39 explicit K7Zip(QIODevice *dev);
40
45 ~K7Zip() override;
46
47protected:
49 bool doWriteSymLink(const QString &name,
50 const QString &target,
51 const QString &user,
52 const QString &group,
53 mode_t perm,
54 const QDateTime &atime,
55 const QDateTime &mtime,
56 const QDateTime &ctime) override;
58 bool doWriteDir(const QString &name,
59 const QString &user,
60 const QString &group,
61 mode_t perm,
62 const QDateTime &atime,
63 const QDateTime &mtime,
64 const QDateTime &ctime) override;
66 bool doPrepareWriting(const QString &name,
67 const QString &user,
68 const QString &group,
69 qint64 size,
70 mode_t perm,
71 const QDateTime &atime,
72 const QDateTime &mtime,
73 const QDateTime &ctime) override;
75 bool doFinishWriting(qint64 size) override;
76
78 bool writeData(const char *data, qint64 size) override;
79
86 bool openArchive(QIODevice::OpenMode mode) override;
87 bool closeArchive() override;
88
89protected:
90 void virtual_hook(int id, void *data) override;
91
92private:
93 class K7ZipPrivate;
94 K7ZipPrivate *const d;
95};
96
97#endif
A class for reading / writing p7zip archives.
Definition k7zip.h:19
bool doWriteDir(const QString &name, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
Reimplemented from KArchive.
bool doFinishWriting(qint64 size) override
Reimplemented from KArchive.
bool openArchive(QIODevice::OpenMode mode) override
Opens the archive for reading.
bool closeArchive() override
Closes the archive.
K7Zip(QIODevice *dev)
Creates an instance that operates on the given device.
bool doWriteSymLink(const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
Reimplemented from KArchive.
~K7Zip() override
If the archive is still opened, then it will be closed automatically by the destructor.
bool writeData(const char *data, qint64 size) override
Reimplemented from KArchive.
K7Zip(const QString &filename)
Creates an instance that operates on the given filename using the compression filter associated to gi...
bool doPrepareWriting(const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
Reimplemented from KArchive.
KArchive is a base class for reading and writing archives.
Definition karchive.h:40