KArchive 5.109.0
krcc.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#ifndef KRCC_H
7#define KRCC_H
8
9#include <karchive.h>
10
19class KARCHIVE_EXPORT KRcc : public KArchive
20{
21 Q_DECLARE_TR_FUNCTIONS(KRcc)
22
23public:
29 KRcc(const QString &filename);
30
35 ~KRcc() override;
36
37protected:
38 /*
39 * Writing is not supported by this class, will always fail.
40 * @return always false
41 */
42 bool doPrepareWriting(const QString &name,
43 const QString &user,
44 const QString &group,
45 qint64 size,
46 mode_t perm,
47 const QDateTime &atime,
48 const QDateTime &mtime,
49 const QDateTime &ctime) override;
50
51 /*
52 * Writing is not supported by this class, will always fail.
53 * @return always false
54 */
55 bool doFinishWriting(qint64 size) override;
56
57 /*
58 * Writing is not supported by this class, will always fail.
59 * @return always false
60 */
61 bool doWriteDir(const QString &name,
62 const QString &user,
63 const QString &group,
64 mode_t perm,
65 const QDateTime &atime,
66 const QDateTime &mtime,
67 const QDateTime &ctime) override;
68
69 /*
70 * Writing is not supported by this class, will always fail.
71 * @return always false
72 */
73 bool doWriteSymLink(const QString &name,
74 const QString &target,
75 const QString &user,
76 const QString &group,
77 mode_t perm,
78 const QDateTime &atime,
79 const QDateTime &mtime,
80 const QDateTime &ctime) override;
81
86 bool openArchive(QIODevice::OpenMode mode) override;
90 bool closeArchive() override;
91
92protected:
93 void virtual_hook(int id, void *data) override;
94
95private:
96 class KRccPrivate;
97 KRccPrivate *const d;
98};
99
100#endif
KArchive is a base class for reading and writing archives.
Definition karchive.h:40
KRcc is a class for reading dynamic binary resources created by Qt's rcc tool from a ....
Definition krcc.h:20
bool doWriteDir(const QString &name, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
Write a directory to the archive.
bool doFinishWriting(qint64 size) override
Called after writing the data.
KRcc(const QString &filename)
Creates an instance that operates on the given filename.
bool closeArchive() override
Unregisters the .rcc resource from the QResource system.
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
Writes a symbolic link to the archive.
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
This virtual method must be implemented by subclasses.
bool openArchive(QIODevice::OpenMode mode) override
Registers the .rcc resource in the QResource system under a unique identifier, then lists that,...
~KRcc() override
If the rcc file is still opened, then it will be closed automatically by the destructor.