8#include <QtCore/qcompare.h>
9#include <QtCore/qfile.h>
10#include <QtCore/qlist.h>
11#include <QtCore/qshareddata.h>
12#include <QtCore/qmetatype.h>
13#include <QtCore/qdatetime.h>
14#include <QtCore/qtimezone.h>
23QT_DECLARE_QSDP_SPECIALIZATION_DTOR(QFileInfoPrivate)
27 friend class QDirIteratorPrivate;
28 friend class QDirListingPrivate;
29 friend class QFileInfoPrivate;
31 explicit QFileInfo(QFileInfoPrivate *d);
33#ifdef QT_IMPLICIT_QFILEINFO_CONSTRUCTION
34#define QFILEINFO_MAYBE_EXPLICIT Q_IMPLICIT
36#define QFILEINFO_MAYBE_EXPLICIT explicit
43 QFileInfo(
const QFileInfo &fileinfo);
44 QFileInfo(QFileInfo &&other) =
default;
46 QFileInfo(
const std::filesystem::path &file);
47 QFileInfo(
const QDir &dir,
const std::filesystem::path &file);
48#elif QT_CONFIG(cxx17_filesystem)
49 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
50 QFILEINFO_MAYBE_EXPLICIT QFileInfo(
const T &file) : QFileInfo(QtPrivate::fromFilesystemPath(file)) { }
52 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
53 QFILEINFO_MAYBE_EXPLICIT QFileInfo(
const QDir &dir,
const T &file) : QFileInfo(dir, QtPrivate::fromFilesystemPath(file))
58#undef QFILEINFO_MAYBE_EXPLICIT
62 QFileInfo &operator=(
const QFileInfo &fileinfo);
63 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QFileInfo)
65 void swap(QFileInfo &other)
noexcept
66 { d_ptr.swap(other.d_ptr); }
68#if QT_CORE_REMOVED_SINCE(6
, 8
)
69 bool operator==(
const QFileInfo &fileinfo)
const;
70 inline bool operator!=(
const QFileInfo &fileinfo)
const {
return !(operator==(fileinfo)); }
73 void setFile(
const QString &file);
74 void setFile(
const QFileDevice &file);
75 void setFile(
const QDir &dir,
const QString &file);
77 void setFile(
const std::filesystem::path &file);
78#elif QT_CONFIG(cxx17_filesystem)
79 template<
typename T, QtPrivate::ForceFilesystemPath<T> = 0>
80 void setFile(
const T &file) { setFile(QtPrivate::fromFilesystemPath(file)); }
84 static bool exists(
const QString &file);
87 QString filePath()
const;
88 QString absoluteFilePath()
const;
89 QString canonicalFilePath()
const;
90#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
91 std::filesystem::path filesystemFilePath()
const
92 {
return QtPrivate::toFilesystemPath(filePath()); }
93 std::filesystem::path filesystemAbsoluteFilePath()
const
94 {
return QtPrivate::toFilesystemPath(absoluteFilePath()); }
95 std::filesystem::path filesystemCanonicalFilePath()
const
96 {
return QtPrivate::toFilesystemPath(canonicalFilePath()); }
98 QString fileName()
const;
99 QString baseName()
const;
100 QString completeBaseName()
const;
101 QString suffix()
const;
102 QString bundleName()
const;
103 QString completeSuffix()
const;
105 QString path()
const;
106 QString absolutePath()
const;
107 QString canonicalPath()
const;
108#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
109 std::filesystem::path filesystemPath()
const {
return QtPrivate::toFilesystemPath(path()); }
110 std::filesystem::path filesystemAbsolutePath()
const
111 {
return QtPrivate::toFilesystemPath(absolutePath()); }
112 std::filesystem::path filesystemCanonicalPath()
const
113 {
return QtPrivate::toFilesystemPath(canonicalPath()); }
116 QDir absoluteDir()
const;
118 bool isReadable()
const;
119 bool isWritable()
const;
120 bool isExecutable()
const;
121 bool isHidden()
const;
122 bool isNativePath()
const;
124 bool isRelative()
const;
125 inline bool isAbsolute()
const {
return !isRelative(); }
130 bool isSymLink()
const;
131 bool isSymbolicLink()
const;
132 bool isOther()
const;
133 bool isShortcut()
const;
134 bool isAlias()
const;
135 bool isJunction()
const;
137 bool isBundle()
const;
139 QString symLinkTarget()
const;
140 QString readSymLink()
const;
141 QString junctionTarget()
const;
143#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
144 std::filesystem::path filesystemSymLinkTarget()
const
145 {
return QtPrivate::toFilesystemPath(symLinkTarget()); }
147 std::filesystem::path filesystemReadSymLink()
const
148 {
return QtPrivate::toFilesystemPath(readSymLink()); }
150 std::filesystem::path filesystemJunctionTarget()
const
151 {
return QtPrivate::toFilesystemPath(junctionTarget()); }
154 QString owner()
const;
155 uint ownerId()
const;
156 QString group()
const;
157 uint groupId()
const;
159 bool permission(QFile::Permissions permissions)
const;
160 QFile::Permissions permissions()
const;
164 QDateTime birthTime()
const {
return fileTime(QFile::FileBirthTime); }
165 QDateTime metadataChangeTime()
const {
return fileTime(QFile::FileMetadataChangeTime); }
166 QDateTime lastModified()
const {
return fileTime(QFile::FileModificationTime); }
167 QDateTime lastRead()
const {
return fileTime(QFile::FileAccessTime); }
168 QDateTime fileTime(QFile::FileTime time)
const;
170 QDateTime birthTime(
const QTimeZone &tz)
const {
return fileTime(QFile::FileBirthTime, tz); }
171 QDateTime metadataChangeTime(
const QTimeZone &tz)
const {
return fileTime(QFile::FileMetadataChangeTime, tz); }
172 QDateTime lastModified(
const QTimeZone &tz)
const {
return fileTime(QFile::FileModificationTime, tz); }
173 QDateTime lastRead(
const QTimeZone &tz)
const {
return fileTime(QFile::FileAccessTime, tz); }
174 QDateTime fileTime(QFile::FileTime time,
const QTimeZone &tz)
const;
176 bool caching()
const;
177 void setCaching(
bool on);
181 QSharedDataPointer<QFileInfoPrivate> d_ptr;
184 friend Q_CORE_EXPORT
bool comparesEqual(
const QFileInfo &lhs,
const QFileInfo &rhs);
185 Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QFileInfo)
186 QFileInfoPrivate* d_func();
187 inline const QFileInfoPrivate* d_func()
const
189 return d_ptr.constData();
197#ifndef QT_NO_DEBUG_STREAM
198Q_CORE_EXPORT
QDebug operator<<(QDebug,
const QFileInfo &);
203QT_DECL_METATYPE_EXTERN(QFileInfo, Q_CORE_EXPORT)
bool testFunctionAttribute(Token tok, FunctionDef *def)
void parseEnumOrFlag(BaseDef *def, QtMocConstants::EnumFlags flags)
bool hasGlobalModuleFragment
void checkSuperClasses(ClassDef *def)
bool inPrivateModuleFragment
bool parseEnum(EnumDef *def, ClassDef *containingClass)
void parseProperty(ClassDef *def, PropertyMode mode)
QByteArray lexemUntil(Token)
EncounteredQmlMacro parseClassInfo(BaseDef *def)
QList< QByteArray > includeFiles
QList< QByteArray > moduleFragmentIncludes
bool requireCompleteTypes
QHash< QByteArray, QByteArray > knownQObjectClasses
void createPropertyDef(PropertyDef &def, int propertyIndex, PropertyMode mode)
void parseClassInfo(ClassDef *def)
QByteArrayView strippedFileName() const
bool parseClassHead(ClassDef *def)
void parsePrivateProperty(ClassDef *def, PropertyMode mode)
void parseFlag(BaseDef *def)
void parsePrivateModuleFragment(qsizetype rewind)
void parseSignals(ClassDef *def)
void parseDeclareMetatype()
void parsePropertyAttributes(PropertyDef &propDef)
void parseInterfaces(ClassDef *def)
bool testFunctionRevision(FunctionDef *def)
bool testFunctionAttribute(FunctionDef *def)
void prependNamespaces(BaseDef &def, const QList< NamespaceDef > &namespaceList) const
QHash< QByteArray, QByteArray > knownGadgets
QList< QByteArray > metaTypes
bool parseFunction(FunctionDef *def, bool inMacro=false)
QByteArray parsePropertyAccessor()
QMap< QString, QJsonArray > metaArgs
bool testForFunctionModifiers(FunctionDef *def)
const QByteArray & toFullyQualified(const QByteArray &name) const noexcept
void parseSlots(ClassDef *def, FunctionDef::Access access)
void parseDeclareInterface()
void checkListSizes(const ClassDef &def)
QTypeRevision parseRevision()
QList< QString > parsedPluginMetadataFiles
qsizetype firstSourceSymbolIndex
ModuleUnitKind moduleUnitKind
bool parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
void checkProperties(ClassDef *cdef)
void parseModuleDeclaration(qsizetype rewind, bool exported)
void parseFunctionArguments(FunctionDef *def)
void parseSlotInPrivate(ClassDef *def, FunctionDef::Access access)
bool inClass(const ClassDef *def) const
void parsePluginData(ClassDef *def)
QByteArray modulePartitionName
void generate(FILE *out, FILE *jsonOutput)
QMap< QByteArray, QByteArray > interface2IdMap
bool inNamespace(const NamespaceDef *def) const
QList< ClassDef > classList
QByteArray resolveIncludeNext(const QByteArray &filename, qsizetype startIndex, qsizetype *foundIndex=nullptr)
void setDebugIncludes(bool value)
void parseDefineArguments(Macro *m)
Symbols preprocessed(const QByteArray &filename, QFile *device)
void substituteUntilNewline(Symbols &substituted)
QList< QByteArray > frameworks
QHash< QByteArray, IncludeResolution > nonlocalIncludePathResolutionCache
static bool preprocessOnly
QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo, qsizetype *foundIndex=nullptr)
static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName)
static Symbols tokenize(const QByteArray &input, int lineNum=1, TokenizeMode mode=TokenizeCpp)
static void macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand, qsizetype &index, int lineNum, bool one, const QSet< QByteArray > &excludeSymbols=QSet< QByteArray >())
@ PreparePreprocessorStatement
@ TokenizePreprocessorStatement
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
The QCommandLineParser class provides a means for handling the command line options.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
std::map< Key, T > toStdMap() const &
friend size_t qHash(const M &key, size_t seed=0) noexcept(QHashPrivate::noexceptPairHash< typename M::key_type, typename M::mapped_type >())
QMap(std::map< Key, T > &&other)
std::map< Key, T > toStdMap() &&
QMap(const std::map< Key, T > &other)
friend bool comparesEqual(const QMap &lhs, const QMap &rhs)
QMap(std::initializer_list< std::pair< Key, T > > list)
void swap(QMap< Key, T > &other) noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
constexpr Integer toEncodedVersion() const
Transforms the revision into an integer value, encoding the minor version into the least significant ...
constexpr QTypeRevision()=default
Produces an invalid revision.
constexpr quint8 majorVersion() const
Returns the major version encoded in the revision.
static constexpr QTypeRevision fromMajorVersion(Major majorVersion)
Produces a QTypeRevision from the given majorVersion with an invalid minor version.
static constexpr bool isValidSegment(Integer segment)
Returns true if the given number can be used as either major or minor version in a QTypeRevision.
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
static constexpr QTypeRevision fromEncodedVersion(Integer value)
Produces a QTypeRevision from the given value.
constexpr bool hasMajorVersion() const
Returns true if the major version is known, otherwise false.
static constexpr QTypeRevision fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
constexpr bool isValid() const
Returns true if the major version or the minor version is known, otherwise false.
friend constexpr Qt::strong_ordering compareThreeWay(const QTypeRevision &lhs, const QTypeRevision &rhs) noexcept
constexpr quint8 minorVersion() const
Returns the minor version encoded in the revision.
static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a val...
friend constexpr bool comparesEqual(const QTypeRevision &lhs, const QTypeRevision &rhs) noexcept
constexpr bool hasMinorVersion() const
Returns true if the minor version is known, otherwise false.
QByteArray unquotedLexem()
const Symbol & symbol() const
bool dontReplaceSymbol(const QByteArray &name) const
const SafeSymbols & constTop() const
QT_BEGIN_NAMESPACE int collectJson(const QStringList &jsonFiles, const QString &outputFile, bool skipStdIn)
Q_DECLARE_TYPEINFO(EnumDef, Q_RELOCATABLE_TYPE)
QByteArray noRef(const QByteArray &type)
Q_DECLARE_TYPEINFO(PropertyDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(NamespaceDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassInfoDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ClassDef::Interface, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(SuperClass, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(ArgumentDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(PrivateQPropertyDef, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(FunctionDef, Q_RELOCATABLE_TYPE)
std::conditional_t< std::is_same_v< HashKey, q20::remove_cvref_t< KeyArgument > >, KeyArgument, HashKey > HeterogenousConstructProxy
Combined button and popup list for selecting options.
constexpr PropertyFlags DefaultPropertyFlags
@ PropertyAccessInStaticMetaCall
@ RequiresVariantMetaObject
QString && asString(QString &&s)
constexpr QAnyStringArg qStringLikeToArg(QAnyStringView s) noexcept
const QString & asString(const QString &s)
std::is_same< Char, char32_t > IsCompatibleChar32TypeHelper
constexpr bool isLatin1(QLatin1StringView s) noexcept
QHash< MacroName, Macro > Macros
Q_DECLARE_TYPEINFO(QDateTime::Data, Q_RELOCATABLE_TYPE)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
#define QFILE_MAYBE_EXPLICIT
#define QFILEINFO_MAYBE_EXPLICIT
QList< QFileInfo > QFileInfoList
qsizetype erase_if(QMultiHash< Key, T > &hash, Predicate pred)
#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(Class)
#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH(Class, Arguments)
#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE(Class)
#define QT_MK_QHASH_COMPAT(X)
QList< QVariant > QVariantList
QMultiMap< Key, T > operator+=(QMultiMap< Key, T > &lhs, const QMultiMap< Key, T > &rhs)
QSet(InputIterator, InputIterator) -> QSet< ValueType >
size_t qHash(const QSet< T > &key, size_t seed=0) noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed)))
qsizetype erase_if(QSet< T > &set, Predicate pred)
QString operator+(const QString &s1, QChar s2)
QString operator+(QString &&lhs, const QString &rhs)
qsizetype erase_if(QString &s, Predicate pred)
#define QT_UNICODE_LITERAL(str)
#define qPrintable(string)
QString operator+(QString &&lhs, QChar rhs)
QString operator+(QChar s1, const QString &s2)
#define QStringLiteral(str)
QString operator+(const QString &s1, const QString &s2)
qsizetype erase(QString &s, const T &t)
static QByteArray combinePath(const QString &infile, const QString &outfile)
static bool hasNext(const Symbols &symbols, int i)
static const Symbol & next(const Symbols &symbols, int &i)
int runMoc(int argc, char **argv)
static auto openFileForWriting(const QString &name)
void error(const char *msg="Invalid argument")
static QStringList argumentsFromCommandLineAndFile(const QStringList &arguments, bool &hasOptionFiles)
QByteArray composePreprocessorOutput(const Symbols &symbols)
Q_DECLARE_TYPEINFO(QTypeRevision, Q_RELOCATABLE_TYPE)
int main(int argc, char *argv[])
[ctor_close]
QByteArray normalizedType
QJsonObject toJson() const
QMap< QByteArray, QByteArray > flagAliases
QList< ClassInfoDef > classInfoList
QList< EnumDef > enumList
Interface(const QByteArray &_className)
QMap< QString, QJsonArray > metaArgs
QList< QList< Interface > > interfaceList
QList< FunctionDef > publicList
QList< FunctionDef > methodList
QList< PropertyDef > propertyList
QList< FunctionDef > constructorList
QList< SuperClass > superclassList
bool requireCompleteMethodTypes
QList< FunctionDef > slotList
QList< FunctionDef > signalList
QJsonObject toJson() const
QList< QByteArray > nonClassSignalList
QFlags< QtMocConstants::EnumFlags > flags
QByteArray qualifiedType(const ClassDef *cdef) const
QJsonObject toJson(const ClassDef &cdef) const
QList< QByteArray > values
QByteArray normalizedType
QJsonObject toJson(int index) const
static void accessToJson(QJsonObject *obj, Access acs)
QByteArray inPrivateClass
QList< ArgumentDef > arguments
bool returnTypeIsVolatile
Simple structure used by the Doc and DocParser classes.
QByteArray inPrivateClass
QJsonObject toJson() const
constexpr QAnyStringArg(QAnyStringView v) noexcept
constexpr QLatin1StringArg(QLatin1StringView v) noexcept
QLatin1StringArg()=default
constexpr QStringViewArg(QStringView v) noexcept
bool operator==(const SubArray &other) const
SubArray(const QByteArray &a)
SubArray(const QByteArray &a, qsizetype from, qsizetype len)
FunctionDef::Access access
QByteArrayView unquotedLexemView() const
Symbol(int lineNum, Token token)
operator SubArray() const
QByteArrayView lexemView() const
void mergeStringLiteral(const Symbol &next)
bool operator==(const Symbol &o) const
Symbol(int lineNum, Token token, const QByteArray &lexem, qsizetype from, qsizetype len)
QByteArray unquotedLexem() const
Symbol(int lineNum, Token token, const QByteArray &lexem)
size_t qHash(const SubArray &key, size_t seed=0)
Q_DECLARE_TYPEINFO(Symbol, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(SafeSymbols, Q_RELOCATABLE_TYPE)
#define FOR_ALL_TOKENS(F)