KArchive 5.109.0
|
Represents a directory entry in a KArchive. More...
#include <KArchiveDirectory>
Public Member Functions | |
KArchiveDirectory (KArchive *archive, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const QString &symlink) | |
Creates a new directory entry. | |
void | addEntry (KArchiveEntry *) |
bool | addEntryV2 (KArchiveEntry *) |
bool | copyTo (const QString &dest, bool recursive=true) const |
Extracts all entries in this archive directory to the directory dest . | |
QStringList | entries () const |
Returns a list of sub-entries. | |
const KArchiveEntry * | entry (const QString &name) const |
Returns the entry in the archive with the given name. | |
const KArchiveFile * | file (const QString &name) const |
Returns the file entry in the archive with the given name. | |
bool | isDirectory () const override |
Checks whether this entry is a directory. | |
void | removeEntry (KArchiveEntry *) |
![]() | |
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) |
Represents a directory entry in a KArchive.
A directory in an archive.
KArchiveDirectory::KArchiveDirectory | ( | KArchive * | archive, |
const QString & | name, | ||
int | access, | ||
const QDateTime & | date, | ||
const QString & | user, | ||
const QString & | group, | ||
const QString & | symlink | ||
) |
Creates a new directory entry.
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() |
bool KArchiveDirectory::copyTo | ( | const QString & | dest, |
bool | recursive = true |
||
) | const |
Extracts all entries in this archive directory to the directory dest
.
dest | the directory to extract to |
recursive | if set to true, subdirectories are extracted as well |
QStringList KArchiveDirectory::entries | ( | ) | const |
Returns a list of sub-entries.
Note that the list is not sorted, it's even in random order (due to using a hashtable). Use sort() on the result to sort the list by filename.
const KArchiveEntry * KArchiveDirectory::entry | ( | const QString & | name | ) | const |
Returns the entry in the archive with the given name.
The entry could be a file or a directory, use isFile() to find out which one it is.
name | may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. |
const KArchiveFile * KArchiveDirectory::file | ( | const QString & | name | ) | const |
Returns the file entry in the archive with the given name.
If the entry exists and is a file, a KArchiveFile is returned. Otherwise, a null pointer is returned. This is a convenience method for entry(), when we know the entry is expected to be a file.
name | may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. |
|
overridevirtual |
Checks whether this entry is a directory.
Reimplemented from KArchiveEntry.
|
overrideprotectedvirtual |
Reimplemented from KArchiveEntry.