4#include "qplatformdefs.h"
23 if (fileEngine ==
nullptr) {
66 ret = fileEngine->fileName(
name);
111 QAbstractFileEngine::FileFlags req;
410 : d_ptr(fileinfo.d_ptr)
482 d_ptr = fileinfo.d_ptr;
581 if (
d->isDefaultConstructed)
599 if (
d->isDefaultConstructed)
625 if (
d->isDefaultConstructed)
641 if (
d->isDefaultConstructed)
658 if (
d->isDefaultConstructed)
660 return d->fileEntry.path();
687 if (
d->isDefaultConstructed)
689 if (
d->fileEngine ==
nullptr)
690 return d->fileEntry.isRelative();
691 return d->fileEngine->isRelativePath();
721 if (
d->isDefaultConstructed)
723 if (
d->fileEngine ==
nullptr) {
726 return d->metaData.exists();
754 return data.exists();
777 if (
d->isDefaultConstructed)
779 return d->fileEntry.filePath();
799 if (
d->isDefaultConstructed)
802 return d->fileEntry.fileName();
821 if (
d->isDefaultConstructed)
845 if (
d->isDefaultConstructed)
848 return d->fileEntry.baseName();
866 if (
d->isDefaultConstructed)
869 return d->fileEntry.completeBaseName();
888 if (
d->isDefaultConstructed)
890 return d->fileEntry.completeSuffix();
911 if (
d->isDefaultConstructed)
913 return d->fileEntry.suffix();
939 return QDir(
d->fileEntry.path());
969 return d->checkAttribute<
bool>(
971 [
d]() {
return d->metaData.isReadable(); },
989 return d->checkAttribute<
bool>(
991 [
d]() {
return d->metaData.isWritable(); },
1009 return d->checkAttribute<
bool>(
1011 [
d]() {
return d->metaData.isExecutable(); },
1030 return d->checkAttribute<
bool>(
1032 [
d]() {
return d->metaData.isHidden(); },
1052 if (
d->isDefaultConstructed)
1054 if (
d->fileEngine ==
nullptr)
1072 return d->checkAttribute<
bool>(
1074 [
d]() {
return d->metaData.isFile(); },
1091 return d->checkAttribute<
bool>(
1093 [
d]() {
return d->metaData.isDirectory(); },
1110 return d->checkAttribute<
bool>(
1112 [
d]() {
return d->metaData.isBundle(); },
1144 return d->checkAttribute<
bool>(
1146 [
d]() {
return d->metaData.isLegacyLink(); },
1173 return d->checkAttribute<
bool>(
1175 [
d]() {
return d->metaData.isLink(); },
1199 return d->checkAttribute<
bool>(
1201 [
d]() {
return d->metaData.isLnkFile(); },
1223 return d->checkAttribute<
bool>(
1225 [
d]() {
return d->metaData.isAlias(); },
1243 return d->checkAttribute<
bool>(
1245 [
d]() {
return d->metaData.isJunction(); },
1257 if (
d->isDefaultConstructed)
1259 if (
d->fileEngine ==
nullptr) {
1260 if (
d->fileEntry.isRoot()) {
1261#if defined(Q_OS_WIN)
1266 return d->metaData.exists();
1292 if (
d->isDefaultConstructed)
1311 if (
d->isDefaultConstructed)
1333 if (
d->isDefaultConstructed)
1354 if (
d->isDefaultConstructed)
1372 return d->checkAttribute(
uint(-2),
1374 [
d]() {
return d->metaData.userId(); },
1393 if (
d->isDefaultConstructed)
1411 return d->checkAttribute(
uint(-2),
1413 [
d]() {
return d->metaData.groupId(); },
1439 auto fseFlags = QFileSystemMetaData::MetaDataFlags::fromInt(
permissions.toInt());
1440 auto feFlags = QAbstractFileEngine::FileFlags::fromInt(
permissions.toInt());
1441 return d->checkAttribute<
bool>(
1461 return d->checkAttribute<QFile::Permissions>(
1463 [
d]() {
return d->metaData.permissions(); },
1481 return d->checkAttribute<
qint64>(
1483 [
d]() {
return d->metaData.size(); },
1487 d->fileSize =
d->fileEngine->size();
1626#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
1669 QFileSystemMetaData::MetaDataFlags flag;
1685 auto fsLambda = [
d,
time]() {
return d->metaData.fileTime(
time); };
1686 auto engineLambda = [
d,
time]() {
return d->getFileTime(
time); };
1688 d->checkAttribute<
QDateTime>(flag, std::move(fsLambda), std::move(engineLambda));
1708 return d->cache_enabled;
1752#ifndef QT_NO_DEBUG_STREAM
\inmodule QtCore \reentrant
FileOwner
\value OwnerUser The user who owns the file.
\inmodule QtCore\reentrant
QDateTime toTimeZone(const QTimeZone &toZone) const
QString filePath(const QString &fileName) const
Returns the path name of a file in the directory.
static QString toNativeSeparators(const QString &pathName)
bool const isDefaultConstructed
QFileSystemMetaData metaData
QDateTime & getFileTime(QFile::FileTime) const
std::unique_ptr< QAbstractFileEngine > const fileEngine
uint getFileFlags(QAbstractFileEngine::FileFlags) const
void setCachedFlag(uint c) const
QString getFileOwner(QAbstractFileEngine::FileOwner own) const
bool getCachedFlag(uint c) const
QFileSystemEntry fileEntry
void refresh()
Refreshes the information about the file system entry this QFileInfo refers to, that is,...
bool isNativePath() const
QString baseName() const
Returns the base name of the file without the path.
bool isSymbolicLink() const
Returns true if this object points to a symbolic link; otherwise returns false.
QString completeSuffix() const
Returns the complete suffix (extension) of the file.
QString symLinkTarget() const
QString suffix() const
Returns the suffix (extension) of the file.
~QFileInfo()
Destroys the QFileInfo and frees its resources.
bool makeAbsolute()
If the file system entry's path is relative, this method converts it to an absolute path and returns ...
QFileInfo & operator=(const QFileInfo &fileinfo)
Move-assigns other to this QFileInfo instance.
uint groupId() const
Returns the id of the group the file belongs to.
bool isRoot() const
Returns true if the object points to a directory or to a symbolic link to a directory,...
void stat()
Reads all attributes from the file system.
void setCaching(bool on)
If enable is true, enables caching of file information.
QString bundleName() const
bool isExecutable() const
void setFile(const QString &file)
QString absoluteFilePath() const
QString readSymLink() const
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
QString canonicalPath() const
Returns the file system entry's canonical path (excluding the entry's name), i.e.
QString completeBaseName() const
Returns the complete base name of the file without the path.
QFileInfo()
Constructs an empty QFileInfo object that doesn't refer to any file system entry.
bool isAlias() const
Returns true if this object points to an alias; otherwise returns false.
QDateTime fileTime(QFile::FileTime time) const
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory.
QString owner() const
Returns the owner of the file.
QSharedDataPointer< QFileInfoPrivate > d_ptr
QString absolutePath() const
Returns the absolute path of the file system entry this QFileInfo refers to, excluding the entry's na...
bool isWritable() const
Returns true if the user can write to the file system entry this QFileInfo refers to; otherwise retur...
uint ownerId() const
Returns the id of the owner of the file.
qint64 size() const
Returns the file size in bytes.
QString junctionTarget() const
QString canonicalFilePath() const
Returns the file system entry's canonical path, including the entry's name, that is,...
QDir absoluteDir() const
Returns a QDir object representing the absolute path of the parent directory of the file system entry...
QDir dir() const
Returns a QDir object representing the path of the parent directory of the file system entry that thi...
bool isHidden() const
Returns true if the file system entry this QFileInfo refers to is ‘hidden’; otherwise returns false.
bool caching() const
Returns true if caching is enabled; otherwise returns false.
bool isRelative() const
Returns true if the file system entry's path is relative, otherwise returns false (that is,...
bool permission(QFile::Permissions permissions) const
Tests for file permissions.
QString path() const
Returns the path of the file system entry this QFileInfo refers to, excluding the entry's name.
bool isShortcut() const
Returns true if this object points to a shortcut; otherwise returns false.
QString filePath() const
Returns the path of the file system entry this QFileInfo refers to; the path may be absolute or relat...
bool exists() const
Returns true if the file system entry this QFileInfo refers to exists; otherwise returns false.
bool isReadable() const
Returns true if the user can read the file system entry this QFileInfo refers to; otherwise returns f...
QFile::Permissions permissions() const
Returns the complete OR-ed together combination of QFile::Permissions for the file.
QString group() const
Returns the group of the file.
static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
static QFileSystemEntry canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
static QFileSystemEntry getRawLinkPath(const QFileSystemEntry &link, QFileSystemMetaData &data)
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
static QString bundleName(const QFileSystemEntry &)
static std::unique_ptr< QAbstractFileEngine > createLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data)
static QFileSystemEntry getJunctionTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
static QFileSystemEntry absoluteName(const QFileSystemEntry &entry)
static QString resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
static QString resolveGroupName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
static bool isCaseSensitive()
Q_AUTOTEST_EXPORT QString baseName() const
Q_AUTOTEST_EXPORT QString completeBaseName() const
Q_AUTOTEST_EXPORT bool isRelative() const
Q_AUTOTEST_EXPORT QString filePath() const
QString fileName() const override
Returns the name set by setFileName() or to the QFile constructors.
const T * constData() const noexcept
Returns a const pointer to the shared data object.
T * data()
Returns a pointer to the shared data object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Combined button and popup list for selecting options.
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * path
QNetworkRequest request(url)