KArchiveFile
#include <KArchiveFile>
Public Member Functions | |
KArchiveFile (KArchive *archive, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink, qint64 pos, qint64 size) | |
~KArchiveFile () override | |
bool | copyTo (const QString &dest) const |
virtual QIODevice * | createDevice () const |
virtual QByteArray | data () const |
bool | isFile () const override |
qint64 | position () const |
void | setSize (qint64 s) |
qint64 | size () const |
Public Member Functions inherited from KArchiveEntry | |
KArchiveEntry (KArchive *archive, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink) | |
QDateTime | date () const |
QString | group () const |
virtual bool | isDirectory () const |
QString | name () const |
mode_t | permissions () const |
QString | symLinkTarget () const |
QString | user () const |
Protected Member Functions | |
void | virtual_hook (int id, void *data) override |
Protected Member Functions inherited from KArchiveEntry | |
KArchive * | archive () const |
Detailed Description
Represents a file entry in a KArchive.
A file in an archive.
- See also
- KArchive
- KArchiveDirectory
Definition at line 24 of file karchivefile.h.
Constructor & Destructor Documentation
◆ KArchiveFile()
KArchiveFile::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.
Do not call this, KArchive takes care of it.
- Parameters
-
archive the entries archive name the name of the entry access the permissions in unix format date the date (in seconds since 1970) user the user that owns the entry group the group that owns the entry symlink the symlink, or QString() pos the position of the file in the directory size the size of the file
Definition at line 771 of file karchive.cpp.
◆ ~KArchiveFile()
|
override |
Destructor.
Do not call this, KArchive takes care of it.
Definition at line 785 of file karchive.cpp.
Member Function Documentation
◆ copyTo()
bool KArchiveFile::copyTo | ( | const QString & | dest | ) | const |
Extracts the file to the directory dest
.
- Parameters
-
dest the directory to extract to
- Returns
- true on success, false if the file (dest + '/' + name()) couldn't be created
Definition at line 848 of file karchive.cpp.
◆ createDevice()
|
virtual |
This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.
This is obviously for reading only.
WARNING: Note that the ownership of the device is being transferred to the caller, who will have to delete it.
The returned device auto-opens (in readonly mode), no need to open it.
- Returns
- the QIODevice of the file
Reimplemented in KZipFileEntry.
Definition at line 821 of file karchive.cpp.
◆ data()
|
virtual |
Returns the data of the file.
Call data() with care (only once per file), this data isn't cached.
- Returns
- the content of this file.
Reimplemented in KZipFileEntry.
Definition at line 805 of file karchive.cpp.
◆ isFile()
|
overridevirtual |
Checks whether this entry is a file.
- Returns
- true, since this entry is a file
Reimplemented from KArchiveEntry.
Definition at line 826 of file karchive.cpp.
◆ position()
qint64 KArchiveFile::position | ( | ) | const |
Position of the data in the [uncompressed] archive.
- Returns
- the position of the file
Definition at line 790 of file karchive.cpp.
◆ setSize()
void KArchiveFile::setSize | ( | qint64 | s | ) |
Set size of data, usually after writing the file.
- Parameters
-
s the new size of the file
Definition at line 800 of file karchive.cpp.
◆ size()
qint64 KArchiveFile::size | ( | ) | const |
◆ virtual_hook()
|
overrideprotectedvirtual |
Reimplemented from KArchiveEntry.
Definition at line 1054 of file karchive.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:55:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.