Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmljsloadergenerator.cpp File Reference

(2e4c66160f0cfbc76b0154d8b989f8931b1963bf)

#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 dependency graph for qqmljsloadergenerator.cpp:

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)

Function Documentation

◆ mangledIdentifier()

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.

Note
Although C++11 allows for non-ascii (unicode) characters to be used in identifiers, many compilers forgot to read the spec and do not implement this. Some also do not implement C99 identifiers, because that is {at the implementation's discretion}. So, we are stuck with plain old boring identifiers.

Definition at line 34 of file qqmljsloadergenerator.cpp.

◆ qQmlJSGenerateLoader()

bool qQmlJSGenerateLoader ( const QStringList & compiledFiles,
const QString & outputFileName,
const QStringList & resourceFileMappings,
QString * errorString )

Definition at line 92 of file qqmljsloadergenerator.cpp.

◆ qQmlJSSymbolNamespaceForPath()

QString qQmlJSSymbolNamespaceForPath ( const QString & relativePath)

Definition at line 66 of file qqmljsloadergenerator.cpp.

◆ qtResourceNameForFile()

QString qtResourceNameForFile ( const QString & fileName)
static

Definition at line 82 of file qqmljsloadergenerator.cpp.