KArchiveDirectory

#include <KArchiveDirectory>

Inheritance diagram for 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 KArchiveEntryentry (const QString &name) const
 
const KArchiveFilefile (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
KArchivearchive () 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 ( 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
archivethe entries archive
namethe name of the entry
accessthe permissions in unix format
datethe date (in seconds since 1970)
userthe user that owns the entry
groupthe group that owns the entry
symlinkthe symlink, or QString()

Definition at line 848 of file karchive.cpp.

Member Function Documentation

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 882 of file karchive.cpp.

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 887 of file karchive.cpp.

bool KArchiveDirectory::copyTo ( const QString dest,
bool  recursive = true 
) const

Extracts all entries in this archive directory to the directory dest.

Parameters
destthe directory to extract to
recursiveif 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 930 of file karchive.cpp.

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 862 of file karchive.cpp.

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
namemay 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 867 of file karchive.cpp.

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
namemay 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 873 of file karchive.cpp.

bool KArchiveDirectory::isDirectory ( ) const
overridevirtual

Checks whether this entry is a directory.

Returns
true, since this entry is a directory

Reimplemented from KArchiveEntry.

Definition at line 920 of file karchive.cpp.

void KArchiveDirectory::removeEntry ( KArchiveEntry entry)

Removes an entry from the directory.

Definition at line 899 of file karchive.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 23:06:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.