Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qfileinfo.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qplatformdefs.h"
5#include "qfileinfo.h"
6#include "qglobal.h"
7#include "qdir.h"
8#include "qfileinfo_p.h"
9#include "qdebug.h"
10
12
13using namespace Qt::StringLiterals;
14
16
17QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
18{
19 if (cache_enabled && !fileNames[(int)name].isNull())
20 return fileNames[(int)name];
21
23 if (fileEngine == nullptr) { // local file; use the QFileSystemEngine directly
24 switch (name) {
28 if (cache_enabled) { // be smart and store both
31 }
33 ret = entry.filePath();
34 else
35 ret = entry.path();
36 break;
37 }
39 ret = QFileSystemEngine::getLinkTarget(fileEntry, metaData).filePath();
40 break;
42 ret = QFileSystemEngine::getRawLinkPath(fileEntry, metaData).filePath();
43 break;
45 ret = QFileSystemEngine::getJunctionTarget(fileEntry, metaData).filePath();
46 break;
49 break;
53 if (cache_enabled) { // be smart and store both
56 }
58 ret = entry.filePath();
59 else
60 ret = entry.path();
61 break;
62 }
63 default: break;
64 }
65 } else {
66 ret = fileEngine->fileName(name);
67 }
68 if (ret.isNull())
69 ret = ""_L1;
70 if (cache_enabled)
71 fileNames[(int)name] = ret;
72 return ret;
73}
74
76{
77 if (cache_enabled && !fileOwners[(int)own].isNull())
78 return fileOwners[(int)own];
80 if (fileEngine == nullptr) {
81 switch (own) {
84 break;
87 break;
88 }
89 } else {
90 ret = fileEngine->owner(own);
91 }
92 if (ret.isNull())
93 ret = ""_L1;
94 if (cache_enabled)
95 fileOwners[(int)own] = ret;
96 return ret;
97}
98
99uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) const
100{
101 Q_ASSERT(fileEngine); // should never be called when using the native FS
102 // We split the testing into tests for for LinkType, BundleType, PermsMask
103 // and the rest.
104 // Tests for file permissions on Windows can be slow, especially on network
105 // paths and NTFS drives.
106 // In order to determine if a file is a symlink or not, we have to lstat().
107 // If we're not interested in that information, we might as well avoid one
108 // extra syscall. Bundle detecton on Mac can be slow, especially on network
109 // paths, so we separate out that as well.
110
111 QAbstractFileEngine::FileFlags req;
112 uint cachedFlags = 0;
113
118 req &= (~QAbstractFileEngine::LinkType);
119 req &= (~QAbstractFileEngine::BundleType);
120
122 }
123
128 }
129 }
130
135 }
136 }
137 }
138
143 }
144 }
145
146 if (req) {
147 if (cache_enabled)
148 req &= (~QAbstractFileEngine::Refresh);
149 else
151
152 QAbstractFileEngine::FileFlags flags = fileEngine->fileFlags(req);
153 fileFlags |= uint(flags.toInt());
155 }
156
157 return fileFlags & request.toInt();
158}
159
161{
162 Q_ASSERT(fileEngine); // should never be called when using the native FS
163 if (!cache_enabled)
164 clearFlags();
165
166 uint cf = 0;
167 switch (request) {
169 cf = CachedATime;
170 break;
172 cf = CachedBTime;
173 break;
175 cf = CachedMCTime;
176 break;
178 cf = CachedMTime;
179 break;
180 }
181
182 if (!getCachedFlag(cf)) {
183 fileTimes[request] = fileEngine->fileTime(request);
184 setCachedFlag(cf);
185 }
186 return fileTimes[request];
187}
188
189//************* QFileInfo
190
337{
338}
339
348{
349}
350
358{
359}
360
371{
372}
373
387 : d_ptr(new QFileInfoPrivate(dir.filePath(file)))
388{
389}
390
395 : d_ptr(fileinfo.d_ptr)
396{
397
398}
399
405{
406}
407
433bool QFileInfo::operator==(const QFileInfo &fileinfo) const
434{
435 Q_D(const QFileInfo);
436 // ### Qt 5: understand long and short file names on Windows
437 // ### (GetFullPathName()).
438 if (fileinfo.d_ptr == d_ptr)
439 return true;
440 if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
441 return false;
442
443 // Assume files are the same if path is the same
444 if (d->fileEntry.filePath() == fileinfo.d_ptr->fileEntry.filePath())
445 return true;
446
447 Qt::CaseSensitivity sensitive;
448 if (d->fileEngine == nullptr || fileinfo.d_ptr->fileEngine == nullptr) {
449 if (d->fileEngine != fileinfo.d_ptr->fileEngine) // one is native, the other is a custom file-engine
450 return false;
451
453 } else {
454 if (d->fileEngine->caseSensitive() != fileinfo.d_ptr->fileEngine->caseSensitive())
455 return false;
456 sensitive = d->fileEngine->caseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive;
457 }
458
459 // Fallback to expensive canonical path computation
460 return canonicalFilePath().compare(fileinfo.canonicalFilePath(), sensitive) == 0;
461}
462
467{
468 d_ptr = fileinfo.d_ptr;
469 return *this;
470}
471
496{
498 *this = QFileInfo(file);
500}
501
514{
516}
517
530{
532}
533
557{
558 Q_D(const QFileInfo);
559 if (d->isDefaultConstructed)
560 return ""_L1;
561 return d->getFileName(QAbstractFileEngine::AbsoluteName);
562}
563
574{
575 Q_D(const QFileInfo);
576 if (d->isDefaultConstructed)
577 return ""_L1;
578 return d->getFileName(QAbstractFileEngine::CanonicalName);
579}
580
581
600{
601 Q_D(const QFileInfo);
602
603 if (d->isDefaultConstructed)
604 return ""_L1;
605 return d->getFileName(QAbstractFileEngine::AbsolutePathName);
606}
607
617{
618 Q_D(const QFileInfo);
619 if (d->isDefaultConstructed)
620 return ""_L1;
621 return d->getFileName(QAbstractFileEngine::CanonicalPathName);
622}
623
634{
635 Q_D(const QFileInfo);
636 if (d->isDefaultConstructed)
637 return ""_L1;
638 return d->fileEntry.path();
639}
640
664{
665 Q_D(const QFileInfo);
666 if (d->isDefaultConstructed)
667 return true;
668 if (d->fileEngine == nullptr)
669 return d->fileEntry.isRelative();
670 return d->fileEngine->isRelativePath();
671}
672
681{
684 return false;
685
687 return true;
688}
689
697{
698 Q_D(const QFileInfo);
699 if (d->isDefaultConstructed)
700 return false;
701 if (d->fileEngine == nullptr) {
702 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
704 return d->metaData.exists();
705 }
706 return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
707}
708
721{
722 if (file.isEmpty())
723 return false;
726 std::unique_ptr<QAbstractFileEngine> engine
728 // Expensive fallback to non-QFileSystemEngine implementation
729 if (engine)
730 return QFileInfo(new QFileInfoPrivate(entry, data, std::move(engine))).exists();
731
733 return data.exists();
734}
735
741{
742 Q_D(QFileInfo);
743 d->clear();
744}
745
753{
754 Q_D(const QFileInfo);
755 if (d->isDefaultConstructed)
756 return ""_L1;
757 return d->fileEntry.filePath();
758}
759
772{
773 Q_D(const QFileInfo);
774 if (d->isDefaultConstructed)
775 return ""_L1;
776 if (!d->fileEngine)
777 return d->fileEntry.fileName();
778 return d->fileEngine->fileName(QAbstractFileEngine::BaseName);
779}
780
794{
795 Q_D(const QFileInfo);
796 if (d->isDefaultConstructed)
797 return ""_L1;
798 return d->getFileName(QAbstractFileEngine::BundleName);
799}
800
818{
819 Q_D(const QFileInfo);
820 if (d->isDefaultConstructed)
821 return ""_L1;
822 if (!d->fileEngine)
823 return d->fileEntry.baseName();
824 return QFileSystemEntry(d->fileEngine->fileName(QAbstractFileEngine::BaseName)).baseName();
825}
826
839{
840 Q_D(const QFileInfo);
841 if (d->isDefaultConstructed)
842 return ""_L1;
843 if (!d->fileEngine)
844 return d->fileEntry.completeBaseName();
845 const QString fileEngineBaseName = d->fileEngine->fileName(QAbstractFileEngine::BaseName);
846 return QFileSystemEntry(fileEngineBaseName).completeBaseName();
847}
848
861{
862 Q_D(const QFileInfo);
863 if (d->isDefaultConstructed)
864 return ""_L1;
865 return d->fileEntry.completeSuffix();
866}
867
884{
885 Q_D(const QFileInfo);
886 if (d->isDefaultConstructed)
887 return ""_L1;
888 return d->fileEntry.suffix();
889}
890
891
911{
912 Q_D(const QFileInfo);
913 return QDir(d->fileEntry.path());
914}
915
922{
923 return QDir(absolutePath());
924}
925
938{
939 Q_D(const QFileInfo);
940 return d->checkAttribute<bool>(
942 [d]() { return (d->metaData.permissions() & QFile::ReadUser) != 0; },
943 [d]() { return d->getFileFlags(QAbstractFileEngine::ReadUserPerm); });
944}
945
958{
959 Q_D(const QFileInfo);
960 return d->checkAttribute<bool>(
962 [d]() { return (d->metaData.permissions() & QFile::WriteUser) != 0; },
963 [d]() { return d->getFileFlags(QAbstractFileEngine::WriteUserPerm); });
964}
965
975{
976 Q_D(const QFileInfo);
977 return d->checkAttribute<bool>(
979 [d]() { return (d->metaData.permissions() & QFile::ExeUser) != 0; },
980 [d]() { return d->getFileFlags(QAbstractFileEngine::ExeUserPerm); });
981}
982
995{
996 Q_D(const QFileInfo);
997 return d->checkAttribute<bool>(
999 [d]() { return d->metaData.isHidden(); },
1000 [d]() { return d->getFileFlags(QAbstractFileEngine::HiddenFlag); });
1001}
1002
1017{
1018 Q_D(const QFileInfo);
1019 if (d->isDefaultConstructed)
1020 return false;
1021 if (d->fileEngine == nullptr)
1022 return true;
1023 return d->getFileFlags(QAbstractFileEngine::LocalDiskFlag);
1024}
1025
1038{
1039 Q_D(const QFileInfo);
1040 return d->checkAttribute<bool>(
1042 [d]() { return d->metaData.isFile(); },
1043 [d]() { return d->getFileFlags(QAbstractFileEngine::FileType); });
1044}
1045
1058{
1059 Q_D(const QFileInfo);
1060 return d->checkAttribute<bool>(
1062 [d]() { return d->metaData.isDirectory(); },
1063 [d]() { return d->getFileFlags(QAbstractFileEngine::DirectoryType); });
1064}
1065
1066
1078{
1079 Q_D(const QFileInfo);
1080 return d->checkAttribute<bool>(
1082 [d]() { return d->metaData.isBundle(); },
1083 [d]() { return d->getFileFlags(QAbstractFileEngine::BundleType); });
1084}
1085
1110{
1111 Q_D(const QFileInfo);
1112 return d->checkAttribute<bool>(
1114 [d]() { return d->metaData.isLegacyLink(); },
1115 [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
1116}
1117
1140{
1141 Q_D(const QFileInfo);
1142 return d->checkAttribute<bool>(
1144 [d]() { return d->metaData.isLink(); },
1145 [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
1146}
1147
1166{
1167 Q_D(const QFileInfo);
1168 return d->checkAttribute<bool>(
1170 [d]() { return d->metaData.isLnkFile(); },
1171 [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
1172}
1173
1190{
1191 Q_D(const QFileInfo);
1192 return d->checkAttribute<bool>(
1194 [d]() { return d->metaData.isAlias(); },
1195 [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
1196}
1197
1210{
1211 Q_D(const QFileInfo);
1212 return d->checkAttribute<bool>(
1214 [d]() { return d->metaData.isJunction(); },
1215 [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
1216}
1217
1224{
1225 Q_D(const QFileInfo);
1226 if (d->isDefaultConstructed)
1227 return false;
1228 if (d->fileEngine == nullptr) {
1229 if (d->fileEntry.isRoot()) {
1230#if defined(Q_OS_WIN)
1231 //the path is a drive root, but the drive may not exist
1232 //for backward compatibility, return true only if the drive exists
1233 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
1235 return d->metaData.exists();
1236#else
1237 return true;
1238#endif
1239 }
1240 return false;
1241 }
1242 return d->getFileFlags(QAbstractFileEngine::RootFlag);
1243}
1244
1259{
1260 Q_D(const QFileInfo);
1261 if (d->isDefaultConstructed)
1262 return ""_L1;
1263 return d->getFileName(QAbstractFileEngine::AbsoluteLinkTarget);
1264}
1265
1278{
1279 Q_D(const QFileInfo);
1280 if (d->isDefaultConstructed)
1281 return {};
1282 return d->getFileName(QAbstractFileEngine::RawLinkPath);
1283}
1284
1300{
1301 Q_D(const QFileInfo);
1302 if (d->isDefaultConstructed)
1303 return ""_L1;
1304 return d->getFileName(QAbstractFileEngine::JunctionName);
1305}
1306
1322{
1323 Q_D(const QFileInfo);
1324 if (d->isDefaultConstructed)
1325 return ""_L1;
1326 return d->getFileOwner(QAbstractFileEngine::OwnerUser);
1327}
1328
1341{
1342 Q_D(const QFileInfo);
1343 return d->checkAttribute(uint(-2),
1345 [d]() { return d->metaData.userId(); },
1346 [d]() { return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser); });
1347}
1348
1363{
1364 Q_D(const QFileInfo);
1365 if (d->isDefaultConstructed)
1366 return ""_L1;
1367 return d->getFileOwner(QAbstractFileEngine::OwnerGroup);
1368}
1369
1382{
1383 Q_D(const QFileInfo);
1384 return d->checkAttribute(uint(-2),
1386 [d]() { return d->metaData.groupId(); },
1387 [d]() { return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup); });
1388}
1389
1409bool QFileInfo::permission(QFile::Permissions permissions) const
1410{
1411 Q_D(const QFileInfo);
1412 // the QFileSystemMetaData::MetaDataFlag and QFile::Permissions overlap, so just cast.
1413 auto fseFlags = QFileSystemMetaData::MetaDataFlags::fromInt(permissions.toInt());
1414 auto feFlags = QAbstractFileEngine::FileFlags::fromInt(permissions.toInt());
1415 return d->checkAttribute<bool>(
1416 fseFlags,
1417 [=]() { return (d->metaData.permissions() & permissions) == permissions; },
1418 [=]() {
1419 return d->getFileFlags(feFlags) == uint(permissions.toInt());
1420 });
1421}
1422
1433QFile::Permissions QFileInfo::permissions() const
1434{
1435 Q_D(const QFileInfo);
1436 return d->checkAttribute<QFile::Permissions>(
1438 [d]() { return d->metaData.permissions(); },
1439 [d]() {
1440 return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
1441 });
1442}
1443
1444
1455{
1456 Q_D(const QFileInfo);
1457 return d->checkAttribute<qint64>(
1459 [d]() { return d->metaData.size(); },
1460 [d]() {
1461 if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
1462 d->setCachedFlag(QFileInfoPrivate::CachedSize);
1463 d->fileSize = d->fileEngine->size();
1464 }
1465 return d->fileSize;
1466 });
1467}
1468
1601#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
1619}
1620#endif
1621
1626
1632
1642{
1643 static_assert(int(QFile::FileAccessTime) == int(QAbstractFileEngine::AccessTime));
1644 static_assert(int(QFile::FileBirthTime) == int(QAbstractFileEngine::BirthTime));
1647
1648 Q_D(const QFileInfo);
1649 auto fetime = QAbstractFileEngine::FileTime(time);
1650 QFileSystemMetaData::MetaDataFlags flag;
1651 switch (time) {
1654 break;
1657 break;
1660 break;
1663 break;
1664 }
1665
1666 auto fsLambda = [d, fetime]() { return d->metaData.fileTime(fetime); };
1667 auto engineLambda = [d, fetime]() { return d->getFileTime(fetime); };
1668 const QDateTime dt = d->checkAttribute<QDateTime>(flag, fsLambda, engineLambda);
1669 return dt.toTimeZone(tz);
1670}
1671
1675QFileInfoPrivate* QFileInfo::d_func()
1676{
1677 return d_ptr.data();
1678}
1679
1686{
1687 Q_D(const QFileInfo);
1688 return d->cache_enabled;
1689}
1690
1704{
1705 Q_D(QFileInfo);
1706 d->cache_enabled = enable;
1707}
1708
1720{
1721 Q_D(QFileInfo);
1723}
1724
1732#ifndef QT_NO_DEBUG_STREAM
1734{
1735 QDebugStateSaver saver(dbg);
1736 dbg.nospace();
1737 dbg.noquote();
1738 dbg << "QFileInfo(" << QDir::toNativeSeparators(fi.filePath()) << ')';
1739 return dbg;
1740}
1741#endif
1742
\inmodule QtCore \reentrant
FileOwner
\value OwnerUser The user who owns the file.
FileTime
These are used by the fileTime() function.
\inmodule QtCore\reentrant
Definition qdatetime.h:257
QDateTime toTimeZone(const QTimeZone &toZone) const
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Definition qdir.h:19
QString filePath(const QString &fileName) const
Returns the path name of a file in the directory.
Definition qdir.cpp:778
static QString toNativeSeparators(const QString &pathName)
Definition qdir.cpp:929
\inmodule QtCore
Definition qfiledevice.h:16
@ FileMetadataChangeTime
Definition qfiledevice.h:44
@ FileModificationTime
Definition qfiledevice.h:45
bool const isDefaultConstructed
QFileSystemMetaData metaData
std::unique_ptr< QAbstractFileEngine > const fileEngine
QDateTime fileTimes[4]
uint getFileFlags(QAbstractFileEngine::FileFlags) const
Definition qfileinfo.cpp:99
void clearFlags() const
void setCachedFlag(uint c) const
QString getFileOwner(QAbstractFileEngine::FileOwner own) const
Definition qfileinfo.cpp:75
QString fileOwners[2]
bool getCachedFlag(uint c) const
QDateTime & getFileTime(QAbstractFileEngine::FileTime) const
QFileSystemEntry fileEntry
\inmodule QtCore \reentrant
Definition qfileinfo.h:22
void refresh()
Refreshes the information about the file, i.e.
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
bool isNativePath() const
QString baseName() const
Returns the base name of the file without the path.
bool isBundle() const
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()
Converts the file's path to an absolute path if it is not already in that form.
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 fileName() const
Returns the name of the file, excluding the path.
QString bundleName() const
bool isExecutable() const
Returns true if the file is executable; otherwise returns false.
void setFile(const QString &file)
Sets the file that the QFileInfo provides information about to file.
QString absoluteFilePath() const
Returns an absolute path including the file name.
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's path canonical path (excluding the file name), i.e.
QString completeBaseName() const
Returns the complete base name of the file without the path.
QFileInfo()
Constructs an empty QFileInfo object.
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.
bool operator==(const QFileInfo &fileinfo) const
Returns true if this QFileInfo object refers to a file in the same location as fileinfo; otherwise re...
QString owner() const
Returns the owner of the file.
QSharedDataPointer< QFileInfoPrivate > d_ptr
Definition qfileinfo.h:171
QString absolutePath() const
Returns a file's path absolute path.
bool isWritable() const
Returns true if the user can write to the file; otherwise returns false.
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 canonical path including the file name, i.e.
QDir absoluteDir() const
Returns the file's absolute path as a QDir object.
QDir dir() const
Returns the path of the object's parent directory as a QDir object.
bool isHidden() const
Returns true if this is a ‘hidden’ file; otherwise returns false.
bool caching() const
Returns true if caching is enabled; otherwise returns false.
bool isRelative() const
Returns true if the file path is relative, otherwise returns false (i.e.
bool permission(QFile::Permissions permissions) const
Tests for file permissions.
QString path() const
Returns the file's path.
bool isShortcut() const
Returns true if this object points to a shortcut; otherwise returns false.
bool isJunction() const
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
bool exists() const
Returns true if the file exists; otherwise returns false.
bool isReadable() const
Returns true if the user can read the file; otherwise returns false.
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 QAbstractFileEngine * resolveEntryAndCreateLegacyEngine(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 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.
Definition qfile.cpp:277
const T * constData() const noexcept
Returns a const pointer to the shared data object.
Definition qshareddata.h:51
T * data()
Returns a pointer to the shared data object.
Definition qshareddata.h:47
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition qstring.cpp:6498
\inmodule QtCore
Definition qtimezone.h:25
Combined button and popup list for selecting options.
CaseSensitivity
@ CaseInsensitive
@ CaseSensitive
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
return ret
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1369
GLbitfield flags
GLboolean enable
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLbyte GLbyte tz
GLuint entry
GLfloat GLfloat p
[1]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
unsigned int uint
Definition qtypes.h:29
long long qint64
Definition qtypes.h:55
QFile file
[0]
QFileInfo fi("c:/temp/foo")
[newstuff]
QString dir
[11]
QStringList fileNames
[4]
QNetworkRequest request(url)
QJSEngine engine
[0]