6.0.0-rc4Source

QDirListing::DirEntry Class

The DirEntry class describes one entry of a QDirListing. More…

Header#include <QDirListing>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
Since6.8
Nested inQDirListing

List of all members, including inherited members

Public Functions

QStringfileName() const
QStringbaseName() const
QStringcompleteBaseName() const
QStringsuffix() const
QStringbundleName() const
QStringcompleteSuffix() const
QStringfilePath() const
QStringcanonicalFilePath() const
QStringabsoluteFilePath() const
QStringabsolutePath() const
boolisDir() const
boolisFile() const
boolisSymLink() const
boolexists() const
boolisHidden() const
boolisReadable() const
boolisWritable() const
boolisExecutable() const
QFileInfofileInfo() const
qint64size() const
QDateTimefileTime(QFile::FileTime type, const QTimeZone &tz) const
QDateTimebirthTime(const QTimeZone &tz) const
QDateTimemetadataChangeTime(const QTimeZone &tz) const
QDateTimelastModified(const QTimeZone &tz) const
QDateTimelastRead(const QTimeZone &tz) const

Detailed Description

Dereferencing a QDirListing::const_iterator gives a DirEntry, which answers the questions a QFileInfo does, for the entry the iterator is at.

See also QFileInfo.

Differences from Qt

The entry holds a QFileInfo, so it stays valid when it is copied out of the loop. bundleName() is always empty.

Member Function Documentation

QString QDirListing::DirEntry::absoluteFilePath() const

Returns the absolute path of the entry.

QString QDirListing::DirEntry::absolutePath() const

Returns the absolute path of the directory that holds the entry.

QString QDirListing::DirEntry::baseName() const

Returns the name of the entry up to its first dot.

QDateTime QDirListing::DirEntry::birthTime(const QTimeZone &tz) const

Returns when the entry was created, in the time zone tz, or an invalid date where the file system does not record it.

QString QDirListing::DirEntry::bundleName() const

Returns the name of the bundle, which only macOS has: an empty string.

QString QDirListing::DirEntry::canonicalFilePath() const

Returns the absolute path of the entry with symbolic links resolved, or an empty string if it does not exist.

QString QDirListing::DirEntry::completeBaseName() const

Returns the name of the entry up to its last dot.

QString QDirListing::DirEntry::completeSuffix() const

Returns what follows the first dot of the name.

bool QDirListing::DirEntry::exists() const

Returns true if the entry exists. A symbolic link whose target is missing does not.

QFileInfo QDirListing::DirEntry::fileInfo() const

Returns a QFileInfo for the entry.

QString QDirListing::DirEntry::fileName() const

Returns the name of the entry, without the path.

QString QDirListing::DirEntry::filePath() const

Returns the path of the entry, which starts with the path given to the QDirListing.

QDateTime QDirListing::DirEntry::fileTime(QFile::FileTime type, const QTimeZone &tz) const

Returns the time stamp type of the entry, in the time zone tz.

bool QDirListing::DirEntry::isDir() const

Returns true if the entry is a directory, or a symbolic link to one.

bool QDirListing::DirEntry::isExecutable() const

Returns true if the user can execute the entry.

bool QDirListing::DirEntry::isFile() const

Returns true if the entry is a regular file, or a symbolic link to one.

bool QDirListing::DirEntry::isHidden() const

Returns true if the entry is hidden: its name starts with a dot.

bool QDirListing::DirEntry::isReadable() const

Returns true if the user can read the entry.

Returns true if the entry is a symbolic link.

bool QDirListing::DirEntry::isWritable() const

Returns true if the user can write to the entry.

QDateTime QDirListing::DirEntry::lastModified(const QTimeZone &tz) const

Returns when the contents of the entry last changed, in the time zone tz.

QDateTime QDirListing::DirEntry::lastRead(const QTimeZone &tz) const

Returns when the entry was last read, in the time zone tz.

QDateTime QDirListing::DirEntry::metadataChangeTime(const QTimeZone &tz) const

Returns when the metadata of the entry last changed, in the time zone tz.

qint64 QDirListing::DirEntry::size() const

Returns the size of the entry in bytes.

QString QDirListing::DirEntry::suffix() const

Returns what follows the last dot of the name.