QDirListing::DirEntry Class
The DirEntry class describes one entry of a QDirListing. More…
| Header | #include <QDirListing> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Since | 6.8 |
| Nested in | QDirListing |
List of all members, including inherited members
Public Functions
| QString | fileName() const |
| QString | baseName() const |
| QString | completeBaseName() const |
| QString | suffix() const |
| QString | bundleName() const |
| QString | completeSuffix() const |
| QString | filePath() const |
| QString | canonicalFilePath() const |
| QString | absoluteFilePath() const |
| QString | absolutePath() const |
| bool | isDir() const |
| bool | isFile() const |
| bool | isSymLink() const |
| bool | exists() const |
| bool | isHidden() const |
| bool | isReadable() const |
| bool | isWritable() const |
| bool | isExecutable() const |
| QFileInfo | fileInfo() const |
| qint64 | size() const |
| QDateTime | fileTime(QFile::FileTime type, const QTimeZone &tz) const |
| QDateTime | birthTime(const QTimeZone &tz) const |
| QDateTime | metadataChangeTime(const QTimeZone &tz) const |
| QDateTime | lastModified(const QTimeZone &tz) const |
| QDateTime | lastRead(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.
bool QDirListing::DirEntry::isSymLink() const
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.