KArchiveDirectory
#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) | |
void | addEntry (KArchiveEntry *) |
bool | addEntryV2 (KArchiveEntry *) |
bool | copyTo (const QString &dest, bool recursive=true) const |
QStringList | entries () const |
const KArchiveEntry * | entry (const QString &name) const |
const KArchiveFile * | file (const QString &name) const |
bool | isDirectory () const override |
void | removeEntry (KArchiveEntry *) |
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 | isFile () 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 directory entry in a KArchive.
A directory in an archive.
- See also
- KArchive
- KArchiveFile
Definition at line 32 of file karchivedirectory.h.
Constructor & Destructor Documentation
◆ KArchiveDirectory()
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.
- 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()
Definition at line 885 of file karchive.cpp.
◆ ~KArchiveDirectory()
|
override |
Definition at line 897 of file karchive.cpp.
Member Function Documentation
◆ addEntry()
void KArchiveDirectory::addEntry | ( | KArchiveEntry * | entry | ) |
Adds a new entry to the directory. Note: this can delete the entry if another one with the same name is already present
Definition at line 922 of file karchive.cpp.
◆ addEntryV2()
bool KArchiveDirectory::addEntryV2 | ( | KArchiveEntry * | entry | ) |
Adds a new entry to the directory.
- Returns
- whether the entry was added or not. Non added entries are deleted
Definition at line 927 of file karchive.cpp.
◆ copyTo()
bool KArchiveDirectory::copyTo | ( | const QString & | dest, |
bool | recursive = true ) const |
Extracts all entries in this archive directory to the directory dest
.
- Parameters
-
dest the directory to extract to recursive if set to true, subdirectories are extracted as well
- Returns
- true on success, false if the directory (dest + '/' + name()) couldn't be created
Definition at line 967 of file karchive.cpp.
◆ entries()
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.
- Returns
- the names of all entries in this directory (filenames, no path).
Definition at line 902 of file karchive.cpp.
◆ entry()
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.
- Parameters
-
name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc.
- Returns
- a pointer to the entry in the directory, or a null pointer if there is no such entry.
Definition at line 907 of file karchive.cpp.
◆ file()
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.
- Parameters
-
name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc.
- Returns
- a pointer to the file entry in the directory, or a null pointer if there is no such file entry.
- Since
- 5.3
Definition at line 913 of file karchive.cpp.
◆ isDirectory()
|
overridevirtual |
Checks whether this entry is a directory.
- Returns
- true, since this entry is a directory
Reimplemented from KArchiveEntry.
Definition at line 957 of file karchive.cpp.
◆ removeEntry()
void KArchiveDirectory::removeEntry | ( | KArchiveEntry * | entry | ) |
Removes an entry from the directory.
Definition at line 938 of file karchive.cpp.
◆ virtual_hook()
|
overrideprotectedvirtual |
Reimplemented from KArchiveEntry.
Definition at line 1059 of file karchive.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.