KArchive 5.109.0
karchivefile.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2000-2005 David Faure <faure@kde.org>
3 SPDX-FileCopyrightText: 2003 Leo Savernik <l.savernik@aon.at>
4
5 Moved from ktar.h by Roberto Teixeira <maragato@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9#ifndef KARCHIVEFILE_H
10#define KARCHIVEFILE_H
11
12#include <karchiveentry.h>
13
14class KArchiveFilePrivate;
24class KARCHIVE_EXPORT KArchiveFile : public KArchiveEntry
25{
26public:
40 const QString &name,
41 int access,
42 const QDateTime &date,
43 const QString &user,
44 const QString &group,
45 const QString &symlink,
46 qint64 pos,
47 qint64 size);
48
52 ~KArchiveFile() override;
53
58 qint64 position() const;
63 qint64 size() const;
68 void setSize(qint64 s);
69
75 virtual QByteArray data() const;
76
87 virtual QIODevice *createDevice() const;
88
93 bool isFile() const override;
94
100 bool copyTo(const QString &dest) const;
101
102protected:
103 void virtual_hook(int id, void *data) override;
104
105private:
106 KArchiveFilePrivate *const d;
107};
108
109#endif
A base class for entries in an KArchive.
Definition karchiveentry.h:36
Represents a file entry in a KArchive.
Definition karchivefile.h:25
KArchiveFile(KArchive *archive, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink, qint64 pos, qint64 size)
Creates a new file entry.
bool copyTo(const QString &dest) const
Extracts the file to the directory dest.
qint64 size() const
Size of the data.
void setSize(qint64 s)
Set size of data, usually after writing the file.
virtual QByteArray data() const
Returns the data of the file.
virtual QIODevice * createDevice() const
This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.
~KArchiveFile() override
Destructor.
qint64 position() const
Position of the data in the [uncompressed] archive.
bool isFile() const override
Checks whether this entry is a file.
KArchive is a base class for reading and writing archives.
Definition karchive.h:40