QDirListing::DirEntry Class
class QDirListing::DirEntry- 상속된 멤버를 포함한 모든 멤버 목록
- DirEntry는 입출력 및 네트워킹의 일부입니다.
공개 함수
| QString | absoluteFilePath() const |
| QString | absolutePath() const |
| QString | baseName() const |
| QDateTime | birthTime(const QTimeZone &tz) const |
| QString | bundleName() const |
| QString | canonicalFilePath() const |
| QString | completeBaseName() const |
| QString | completeSuffix() const |
| bool | exists() const |
| QFileInfo | fileInfo() const |
| QString | fileName() const |
| QString | filePath() const |
| QDateTime | fileTime(QFileDevice::FileTime type, const QTimeZone &tz) const |
| bool | isDir() const |
| bool | isExecutable() const |
| bool | isFile() const |
| bool | isHidden() const |
| bool | isReadable() const |
| bool | isSymLink() const |
| bool | isWritable() const |
| QDateTime | lastModified(const QTimeZone &tz) const |
| QDateTime | lastRead(const QTimeZone &tz) const |
| QDateTime | metadataChangeTime(const QTimeZone &tz) const |
| qint64 | size() const |
| QString | suffix() const |
상세 설명
유효한 QDirListing::const_iterator 의 참조를 해제하면 DirEntry 개체가 반환됩니다.
DirEntry는 QFileInfo 의 API 중 일부(예: fileName(), filePath(), exists())를 제공합니다. 내부적으로 DirEntry는 필요한 경우, 즉 다른 시스템 함수에 의해 해당 정보가 이미 가져오지 않은 경우에만 QFileInfo 객체를 생성합니다. DirEntry::fileInfo()를 사용하여 QFileInfo 를 가져올 수 있습니다. 예:
using ItFlag = QDirListing::IteratorFlag;
for (const auto &dirEntry : QDirListing(u"/etc"_s, ItFlag::Recursive)) {
// Faster
if (dirEntry.fileName().endsWith(u".conf")) { /* ... */ }
// This works, but might be potentially slower, since it has to construct a
// QFileInfo, whereas (depending on the implementation) the fileName could
// be known already
if (dirEntry.fileInfo().fileName().endsWith(u".conf")) { /* ... */ }
}
using ItFlag = QDirListing::IteratorFlag;
for (const auto &dirEntry : QDirListing(u"/etc"_s, ItFlag::Recursive)) {
// Both approaches are the same, because DirEntry will have to construct
// a QFileInfo to get this info (for example, by calling system stat())
if (dirEntry.size() >= 4'000 /* 4KB */) { /* ...*/ }
if (dirEntry.fileInfo().size() >= 4'000 /* 4KB */) { /* ... */ }
}멤버 함수 문서
QDateTime DirEntry::birthTime(const QTimeZone &tz) const
QDateTime DirEntry::fileTime(QFileDevice::FileTime type, const QTimeZone &tz) const
QDateTime DirEntry::lastModified(const QTimeZone &tz) const
QDateTime DirEntry::lastRead(const QTimeZone &tz) const
QDateTime DirEntry::metadataChangeTime(const QTimeZone &tz) const
QFileInfo DirEntry::fileInfo() const
QString DirEntry::absoluteFilePath() const
QString DirEntry::absolutePath() const
QString DirEntry::baseName() const
QString DirEntry::bundleName() const
QString DirEntry::canonicalFilePath() const
QString DirEntry::completeBaseName() const
QString DirEntry::completeSuffix() const
QString DirEntry::fileName() const
QString DirEntry::filePath() const
QString DirEntry::suffix() const
bool DirEntry::exists() const
bool DirEntry::isDir() const
bool DirEntry::isExecutable() const
bool DirEntry::isFile() const
bool DirEntry::isHidden() const
bool DirEntry::isReadable() const
bool DirEntry::isSymLink() const
bool DirEntry::isWritable() const
qint64 DirEntry::size() const
동일한 이름을 가진 QFileInfo 메서드를 참조하십시오.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.