KArchive 5.109.0
|
Represents a file entry in a KArchive. More...
#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) | |
Creates a new file entry. | |
~KArchiveFile () override | |
Destructor. | |
bool | copyTo (const QString &dest) const |
Extracts the file to the directory dest . | |
virtual QIODevice * | createDevice () const |
This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice. | |
virtual QByteArray | data () const |
Returns the data of the file. | |
bool | isFile () const override |
Checks whether this entry is a file. | |
qint64 | position () const |
Position of the data in the [uncompressed] archive. | |
void | setSize (qint64 s) |
Set size of data, usually after writing the file. | |
qint64 | size () const |
Size of the data. | |
![]() | |
KArchiveEntry (KArchive *archive, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink) | |
Creates a new entry. | |
QDateTime | date () const |
Creation date of the file. | |
QString | group () const |
Group of the user who created the file. | |
virtual bool | isDirectory () const |
Checks whether the entry is a directory. | |
virtual bool | isFile () const |
Checks whether the entry is a file. | |
QString | name () const |
Name of the file without path. | |
mode_t | permissions () const |
The permissions and mode flags as returned by the stat() function in st_mode. | |
QString | symLinkTarget () const |
Symlink if there is one. | |
QString | user () const |
User who created the file. | |
Protected Member Functions | |
void | virtual_hook (int id, void *data) override |
![]() | |
KArchive * | archive () const |
virtual void | virtual_hook (int id, void *data) |
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.
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 |
|
override |
Destructor.
Do not call this, KArchive takes care of it.
bool KArchiveFile::copyTo | ( | const QString & | dest | ) | const |
Extracts the file to the directory dest
.
dest | the directory to extract to |
|
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.
Reimplemented in KZipFileEntry.
|
virtual |
Returns the data of the file.
Call data() with care (only once per file), this data isn't cached.
Reimplemented in KZipFileEntry.
|
overridevirtual |
Checks whether this entry is a file.
Reimplemented from KArchiveEntry.
qint64 KArchiveFile::position | ( | ) | const |
Position of the data in the [uncompressed] archive.
void KArchiveFile::setSize | ( | qint64 | s | ) |
Set size of data, usually after writing the file.
s | the new size of the file |
qint64 KArchiveFile::size | ( | ) | const |
Size of the data.
|
overrideprotectedvirtual |
Reimplemented from KArchiveEntry.