![]() |
Qt 6.x
The Qt SDK
|
#include "qqmljsloadergenerator_p.h"
#include <QByteArray>
#include <QRegularExpression>
#include <QString>
#include <QStringList>
#include <QTextStream>
#include <QVector>
#include <QtEndian>
#include <QStack>
#include <QFileInfo>
#include <QSaveFile>
#include <algorithm>
Go to the source code of this file.
Functions | |
QT_BEGIN_NAMESPACE QString | mangledIdentifier (const QString &str) |
QString | qQmlJSSymbolNamespaceForPath (const QString &relativePath) |
static QString | qtResourceNameForFile (const QString &fileName) |
bool | qQmlJSGenerateLoader (const QStringList &compiledFiles, const QString &outputFileName, const QStringList &resourceFileMappings, QString *errorString) |
QT_BEGIN_NAMESPACE QString mangledIdentifier | ( | const QString & | str | ) |
Mangles str to be a unique C++ identifier. Characters that are invalid for C++ identifiers are replaced by the pattern _0x<hex>_
where <hex> is the hexadecimal unicode representation of the character. As identifiers with leading underscores followed by either another underscore or a capital letter are reserved in C++, we also escape those, by escaping the first underscore, using the above method.
Definition at line 35 of file qqmljsloadergenerator.cpp.
References QString::at(), ch, i, QString::isEmpty(), QString::number(), Q_ASSERT, QString::reserve(), QString::size(), QString::startsWith(), str, and QChar::unicode().
Referenced by qQmlJSSymbolNamespaceForPath().
bool qQmlJSGenerateLoader | ( | const QStringList & | compiledFiles, |
const QString & | outputFileName, | ||
const QStringList & | resourceFileMappings, | ||
QString * | errorString | ||
) |
Definition at line 93 of file qqmljsloadergenerator.cpp.
References i, QString::indexOf(), QString::isEmpty(), QString::mid(), qQmlJSSymbolNamespaceForPath(), QStringLiteral, qtResourceNameForFile(), QByteArray::size(), QIODeviceBase::Truncate, QString::truncate(), and QIODeviceBase::WriteOnly.
Definition at line 67 of file qqmljsloadergenerator.cpp.
References QFileInfo::baseName(), QString::clear(), QFileInfo::completeSuffix(), fi, mangledIdentifier(), QFileInfo::path(), QString::replace(), QString::size(), and QString::startsWith().
Referenced by qQmlJSGenerateLoader(), and qSaveQmlJSUnitAsCpp().
Definition at line 83 of file qqmljsloadergenerator.cpp.
References QFileInfo::completeBaseName(), fi, QFileInfo::fileName(), fileName, and QString::replace().
Referenced by qQmlJSGenerateLoader().