Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QV4::CompiledData::CompilationUnit Struct Referencefinal

#include <qv4compileddata_p.h>

+ Inheritance diagram for QV4::CompiledData::CompilationUnit:
+ Collaboration diagram for QV4::CompiledData::CompilationUnit:

Classes

struct  FunctionIterator
 
class  IdToObjectMap
 

Public Types

enum class  ListPropertyAssignBehavior { Append , Replace , ReplaceIfNotDefault }
 
using CompiledObject = const CompiledData::Object
 
using CompiledFunction = const CompiledData::Function
 
using CompiledBinding = const CompiledData::Binding
 

Public Member Functions

 CompilationUnit (const Unit *unitData, const QQmlPrivate::AOTCompiledFunction *aotCompiledFunctions, const QString &fileName=QString(), const QString &finalUrlString=QString())
 
Q_QML_EXPORT CompilationUnit (const Unit *unitData=nullptr, const QString &fileName=QString(), const QString &finalUrlString=QString())
 
Q_QML_EXPORT ~CompilationUnit ()
 
const UnitunitData () const
 
void setUnitData (const Unit *unitData, const QmlUnit *qmlUnit=nullptr, const QString &fileName=QString(), const QString &finalUrlString=QString())
 
QString stringAt (uint index) const
 
QString fileName () const
 
QString finalUrlString () const
 
QString bindingValueAsString (const CompiledData::Binding *binding) const
 
QString bindingValueAsScriptString (const CompiledData::Binding *binding) const
 
double bindingValueAsNumber (const CompiledData::Binding *binding) const
 
Q_QML_EXPORT bool loadFromDisk (const QUrl &url, const QDateTime &sourceTimeStamp, QString *errorString)
 
Q_QML_EXPORT bool saveToDisk (const QUrl &unitUrl, QString *errorString)
 
int importCount () const
 
const CompiledData::ImportimportAt (int index) const
 
Q_QML_EXPORT QStringList moduleRequests () const
 
QUrl url () const
 
QUrl finalUrl () const
 
ResolvedTypeReferenceresolvedType (int id) const
 
ResolvedTypeReferenceresolvedType (QMetaType type) const
 
QQmlPropertyCache::ConstPtr rootPropertyCache () const
 
int objectCount () const
 
const CompiledObjectobjectAt (int index) const
 
int totalBindingsCount () const
 
int totalParserStatusCount () const
 
int totalObjectCount () const
 
int inlineComponentId (const QString &inlineComponentName) const
 
void finalizeCompositeType (const QQmlType &type)
 
bool verifyChecksum (const CompiledData::DependentTypesHasher &dependencyHasher) const
 
ListPropertyAssignBehavior listPropertyAssignBehavior () const
 
bool ignoresFunctionSignature () const
 
bool nativeMethodsAcceptThisObjects () const
 
bool valueTypesAreCopied () const
 
bool valueTypesAreAddressable () const
 
bool componentsAreBound () const
 
bool isESModule () const
 
bool isSharedLibrary () const
 
FunctionIterator objectFunctionsBegin (const CompiledObject *object) const
 
FunctionIterator objectFunctionsEnd (const CompiledObject *object) const
 
QQmlType qmlTypeForComponent (const QString &inlineComponentName=QString()) const
 
QMetaType metaType () const
 
- Public Member Functions inherited from QQmlRefCounted< CompilationUnit >
void release () const
 
- Public Member Functions inherited from QQmlRefCount
 QQmlRefCount ()
 
void addref () const
 
int count () const
 

Static Public Member Functions

static Q_QML_EXPORT QString localCacheFilePath (const QUrl &url)
 

Public Attributes

const Unitdata = nullptr
 
const QmlUnitqmlData = nullptr
 
QStringList dynamicStrings
 
const QQmlPrivate::AOTCompiledFunctionaotCompiledFunctions = nullptr
 
const StaticValueconstants = nullptr
 
std::unique_ptr< CompilationUnitMapperbackingFile
 
int m_totalBindingsCount = 0
 
int m_totalParserStatusCount = 0
 
int m_totalObjectCount = 0
 
std::unique_ptr< QStringicRootName
 
QHash< QString, InlineComponentDatainlineComponentData
 
QVector< BindingPropertyDatabindingPropertyDataPerObject
 
ResolvedTypeReferenceMap resolvedTypes
 
QQmlRefPointer< QQmlTypeNameCachetypeNameCache
 
QQmlPropertyCacheVector propertyCaches
 
QQmlType qmlType
 
QVector< QQmlRefPointer< QQmlScriptData > > dependentScripts
 

Additional Inherited Members

- Protected Member Functions inherited from QQmlRefCounted< CompilationUnit >
 ~QQmlRefCounted ()
 

Detailed Description

Definition at line 1468 of file qv4compileddata_p.h.

Member Typedef Documentation

◆ CompiledBinding

◆ CompiledFunction

◆ CompiledObject

Member Enumeration Documentation

◆ ListPropertyAssignBehavior

Enumerator
Append 
Replace 
ReplaceIfNotDefault 

Definition at line 1679 of file qv4compileddata_p.h.

Constructor & Destructor Documentation

◆ CompilationUnit() [1/2]

QV4::CompiledData::CompilationUnit::CompilationUnit ( const Unit * unitData,
const QQmlPrivate::AOTCompiledFunction * aotCompiledFunctions,
const QString & fileName = QString(),
const QString & finalUrlString = QString() )
inlineexplicit

Definition at line 1520 of file qv4compileddata_p.h.

References aotCompiledFunctions.

◆ CompilationUnit() [2/2]

QV4::CompiledData::CompilationUnit::CompilationUnit ( const Unit * unitData = nullptr,
const QString & fileName = QString(),
const QString & finalUrlString = QString() )

Definition at line 111 of file qv4compileddata.cpp.

References fileName(), finalUrlString(), setUnitData(), and unitData().

+ Here is the call graph for this function:

◆ ~CompilationUnit()

QV4::CompiledData::CompilationUnit::~CompilationUnit ( )

Definition at line 117 of file qv4compileddata.cpp.

References constants, qDeleteAll(), qmlData, resolvedTypes, and QV4::CompiledData::Unit::StaticData.

+ Here is the call graph for this function:

Member Function Documentation

◆ bindingValueAsNumber()

double QV4::CompiledData::CompilationUnit::bindingValueAsNumber ( const CompiledData::Binding * binding) const
inline

Definition at line 1609 of file qv4compileddata_p.h.

References constants, QV4::StaticValue::doubleValue(), QV4::CompiledData::Binding::type(), QV4::CompiledData::Binding::Type_Number, and QV4::CompiledData::Binding::value.

Referenced by bindingValueAsString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bindingValueAsScriptString()

QString QV4::CompiledData::CompilationUnit::bindingValueAsScriptString ( const CompiledData::Binding * binding) const
inline

Definition at line 1602 of file qv4compileddata_p.h.

References bindingValueAsString(), QV4::CompiledData::Binding::escapedString(), stringAt(), QV4::CompiledData::Binding::stringIndex, QV4::CompiledData::Binding::type(), and QV4::CompiledData::Binding::Type_String.

+ Here is the call graph for this function:

◆ bindingValueAsString()

QString QV4::CompiledData::CompilationUnit::bindingValueAsString ( const CompiledData::Binding * binding) const
inline

◆ componentsAreBound()

bool QV4::CompiledData::CompilationUnit::componentsAreBound ( ) const
inline

Definition at line 1709 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::ComponentsBound, QV4::CompiledData::Unit::flags, and unitData().

+ Here is the call graph for this function:

◆ fileName()

QString QV4::CompiledData::CompilationUnit::fileName ( ) const
inline

Definition at line 1575 of file qv4compileddata_p.h.

Referenced by CompilationUnit(), QQmlTypeData::done(), setUnitData(), and url().

+ Here is the caller graph for this function:

◆ finalizeCompositeType()

void QV4::CompiledData::CompilationUnit::finalizeCompositeType ( const QQmlType & type)

Definition at line 288 of file qv4compileddata.cpp.

References QQmlMetaType::findCompositeType(), i, QV4::CompiledData::Object::IsInlineComponentRoot, QV4::CompiledData::Object::IsPartOfInlineComponent, QV4::CompiledData::Unit::IsSingleton, it, QQmlMetaType::NonSingleton, QV4::CompiledData::processInlinComponentType(), Q_ASSERT, QQmlMetaType::registerInternalCompositeType(), and QQmlMetaType::Singleton.

Referenced by QQmlTypeData::done().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalUrl()

QUrl QV4::CompiledData::CompilationUnit::finalUrl ( ) const
inline

Definition at line 1640 of file qv4compileddata_p.h.

References finalUrlString(), and QQmlNullableValue< T >::isValid().

+ Here is the call graph for this function:

◆ finalUrlString()

QString QV4::CompiledData::CompilationUnit::finalUrlString ( ) const
inline

Definition at line 1576 of file qv4compileddata_p.h.

Referenced by CompilationUnit(), finalUrl(), and setUnitData().

+ Here is the caller graph for this function:

◆ ignoresFunctionSignature()

bool QV4::CompiledData::CompilationUnit::ignoresFunctionSignature ( ) const
inline

Definition at line 1689 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, QV4::CompiledData::Unit::FunctionSignaturesIgnored, and unitData().

+ Here is the call graph for this function:

◆ importAt()

const CompiledData::Import * QV4::CompiledData::CompilationUnit::importAt ( int index) const
inline

Definition at line 1622 of file qv4compileddata_p.h.

References QV4::CompiledData::QmlUnit::importAt(), and qmlData.

+ Here is the call graph for this function:

◆ importCount()

int QV4::CompiledData::CompilationUnit::importCount ( ) const
inline

Definition at line 1621 of file qv4compileddata_p.h.

References QV4::CompiledData::QmlUnit::nImports, and qmlData.

◆ inlineComponentId()

int QV4::CompiledData::CompilationUnit::inlineComponentId ( const QString & inlineComponentName) const
inline

Definition at line 1662 of file qv4compileddata_p.h.

References i, it, QV4::CompiledData::QmlUnit::nObjects, QV4::CompiledData::QmlUnit::objectAt(), qmlData, and stringAt().

+ Here is the call graph for this function:

◆ isESModule()

bool QV4::CompiledData::CompilationUnit::isESModule ( ) const
inline

Definition at line 1714 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, QV4::CompiledData::Unit::IsESModule, and unitData().

Referenced by QQmlScriptData::scriptValueForContext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSharedLibrary()

bool QV4::CompiledData::CompilationUnit::isSharedLibrary ( ) const
inline

Definition at line 1719 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, QV4::CompiledData::Unit::IsSharedLibrary, and unitData().

Referenced by QQmlScriptData::scriptValueForContext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listPropertyAssignBehavior()

ListPropertyAssignBehavior QV4::CompiledData::CompilationUnit::listPropertyAssignBehavior ( ) const
inline

Definition at line 1680 of file qv4compileddata_p.h.

References Append, QV4::CompiledData::Unit::ListPropertyAssignReplace, QV4::CompiledData::Unit::ListPropertyAssignReplaceIfNotDefault, Replace, ReplaceIfNotDefault, and unitData().

+ Here is the call graph for this function:

◆ loadFromDisk()

bool QV4::CompiledData::CompilationUnit::loadFromDisk ( const QUrl & url,
const QDateTime & sourceTimeStamp,
QString * errorString )

Definition at line 154 of file qv4compileddata.cpp.

References backingFile, dynamicStrings, QQmlFile::isLocalFile(), localCacheFilePath(), qScopeGuard(), QStringLiteral, setUnitData(), QV4::CompiledData::Unit::StaticData, stringAt(), unitData(), url(), and QQmlFile::urlToLocalFileOrQrc().

+ Here is the call graph for this function:

◆ localCacheFilePath()

QString QV4::CompiledData::CompilationUnit::localCacheFilePath ( const QUrl & url)
static

Definition at line 136 of file qv4compileddata.cpp.

References QStandardPaths::CacheLocation, QFileInfo::completeSuffix(), directory, QString::fromLocal8Bit(), QString::fromUtf8(), QString::isEmpty(), qgetenv(), QDir::root(), QCryptographicHash::Sha1, url(), QQmlFile::urlToLocalFileOrQrc(), and QStandardPaths::writableLocation().

Referenced by loadFromDisk(), and saveToDisk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ metaType()

QMetaType QV4::CompiledData::CompilationUnit::metaType ( ) const
inline

Definition at line 1753 of file qv4compileddata_p.h.

References qmlType, and QQmlType::typeId().

+ Here is the call graph for this function:

◆ moduleRequests()

QStringList QV4::CompiledData::CompilationUnit::moduleRequests ( ) const

Definition at line 229 of file qv4compileddata.cpp.

References i, requests, and stringAt().

+ Here is the call graph for this function:

◆ nativeMethodsAcceptThisObjects()

bool QV4::CompiledData::CompilationUnit::nativeMethodsAcceptThisObjects ( ) const
inline

Definition at line 1694 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, QV4::CompiledData::Unit::NativeMethodsAcceptThisObject, and unitData().

+ Here is the call graph for this function:

◆ objectAt()

const CompiledObject * QV4::CompiledData::CompilationUnit::objectAt ( int index) const
inline

Definition at line 1656 of file qv4compileddata_p.h.

References QV4::CompiledData::QmlUnit::objectAt(), and qmlData.

+ Here is the call graph for this function:

◆ objectCount()

int QV4::CompiledData::CompilationUnit::objectCount ( ) const
inline

Definition at line 1655 of file qv4compileddata_p.h.

References QV4::CompiledData::QmlUnit::nObjects, and qmlData.

◆ objectFunctionsBegin()

FunctionIterator QV4::CompiledData::CompilationUnit::objectFunctionsBegin ( const CompiledObject * object) const
inline

Definition at line 1742 of file qv4compileddata_p.h.

References unitData().

+ Here is the call graph for this function:

◆ objectFunctionsEnd()

FunctionIterator QV4::CompiledData::CompilationUnit::objectFunctionsEnd ( const CompiledObject * object) const
inline

Definition at line 1747 of file qv4compileddata_p.h.

References unitData().

+ Here is the call graph for this function:

◆ qmlTypeForComponent()

QQmlType QV4::CompiledData::CompilationUnit::qmlTypeForComponent ( const QString & inlineComponentName = QString()) const

Definition at line 421 of file qv4compileddata.cpp.

References inlineComponentData, QString::isEmpty(), and qmlType.

+ Here is the call graph for this function:

◆ resolvedType() [1/2]

ResolvedTypeReference * QV4::CompiledData::CompilationUnit::resolvedType ( int id) const
inline

Definition at line 1647 of file qv4compileddata_p.h.

References resolvedTypes, and QHash< Key, T >::value().

+ Here is the call graph for this function:

◆ resolvedType() [2/2]

ResolvedTypeReference * QV4::CompiledData::CompilationUnit::resolvedType ( QMetaType type) const

Definition at line 238 of file qv4compileddata.cpp.

References resolvedTypes.

◆ rootPropertyCache()

QQmlPropertyCache::ConstPtr QV4::CompiledData::CompilationUnit::rootPropertyCache ( ) const
inline

Definition at line 1650 of file qv4compileddata_p.h.

References QQmlPropertyCacheVector::at(), and propertyCaches.

Referenced by QQmlTypePrivate::compositePropertyCache(), QV4::ResolvedTypeReference::createPropertyCache(), QV4::ResolvedTypeReference::doDynamicTypeCheck(), QV4::ResolvedTypeReference::propertyCache(), and QQmlTypePrivate::resolveCompositeBaseType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDisk()

bool QV4::CompiledData::CompilationUnit::saveToDisk ( const QUrl & unitUrl,
QString * errorString )

Definition at line 204 of file qv4compileddata.cpp.

References data, QV4::CompilationUnitMapper::invalidate(), QQmlFile::isLocalFile(), localCacheFilePath(), QStringLiteral, QV4::CompiledData::SaveableUnitPointer::saveToDisk(), unitData(), and QV4::CompiledData::SaveableUnitPointer::writeDataToFile().

+ Here is the call graph for this function:

◆ setUnitData()

void QV4::CompiledData::CompilationUnit::setUnitData ( const Unit * unitData,
const QmlUnit * qmlUnit = nullptr,
const QString & fileName = QString(),
const QString & finalUrlString = QString() )
inline

Definition at line 1535 of file qv4compileddata_p.h.

References QString::clear(), constants, fileName(), finalUrlString(), QV4::StaticValue::fromReturnedValue(), i, QString::isEmpty(), qmlData, stringAt(), and unitData().

Referenced by CompilationUnit(), and loadFromDisk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringAt()

QString QV4::CompiledData::CompilationUnit::stringAt ( uint index) const
inline

Definition at line 1565 of file qv4compileddata_p.h.

References dynamicStrings, and Q_ASSERT.

Referenced by bindingValueAsScriptString(), bindingValueAsString(), inlineComponentId(), loadFromDisk(), moduleRequests(), setUnitData(), QQmlScriptBlob::stringAt(), and QQmlTypeData::stringAt().

+ Here is the caller graph for this function:

◆ totalBindingsCount()

int QV4::CompiledData::CompilationUnit::totalBindingsCount ( ) const

Definition at line 248 of file qv4compileddata.cpp.

References icRootName, inlineComponentData, and m_totalBindingsCount.

◆ totalObjectCount()

int QV4::CompiledData::CompilationUnit::totalObjectCount ( ) const

Definition at line 255 of file qv4compileddata.cpp.

References icRootName, inlineComponentData, and m_totalObjectCount.

◆ totalParserStatusCount()

int QV4::CompiledData::CompilationUnit::totalParserStatusCount ( ) const

Definition at line 399 of file qv4compileddata.cpp.

References icRootName, inlineComponentData, and m_totalParserStatusCount.

◆ unitData()

const Unit * QV4::CompiledData::CompilationUnit::unitData ( ) const
inline

◆ url()

QUrl QV4::CompiledData::CompilationUnit::url ( ) const
inline

Definition at line 1633 of file qv4compileddata_p.h.

References fileName(), and QQmlNullableValue< T >::isValid().

Referenced by loadFromDisk(), and localCacheFilePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valueTypesAreAddressable()

bool QV4::CompiledData::CompilationUnit::valueTypesAreAddressable ( ) const
inline

Definition at line 1704 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, unitData(), and QV4::CompiledData::Unit::ValueTypesAddressable.

+ Here is the call graph for this function:

◆ valueTypesAreCopied()

bool QV4::CompiledData::CompilationUnit::valueTypesAreCopied ( ) const
inline

Definition at line 1699 of file qv4compileddata_p.h.

References QV4::CompiledData::Unit::flags, unitData(), and QV4::CompiledData::Unit::ValueTypesCopied.

+ Here is the call graph for this function:

◆ verifyChecksum()

bool QV4::CompiledData::CompilationUnit::verifyChecksum ( const CompiledData::DependentTypesHasher & dependencyHasher) const

Definition at line 406 of file qv4compileddata.cpp.

References checksum(), and i.

Referenced by QQmlTypeData::done().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ aotCompiledFunctions

const QQmlPrivate::AOTCompiledFunction* QV4::CompiledData::CompilationUnit::aotCompiledFunctions = nullptr

Definition at line 1475 of file qv4compileddata_p.h.

Referenced by CompilationUnit().

◆ backingFile

std::unique_ptr<CompilationUnitMapper> QV4::CompiledData::CompilationUnit::backingFile

Definition at line 1480 of file qv4compileddata_p.h.

Referenced by loadFromDisk().

◆ bindingPropertyDataPerObject

QVector<BindingPropertyData> QV4::CompiledData::CompilationUnit::bindingPropertyDataPerObject

Definition at line 1492 of file qv4compileddata_p.h.

◆ constants

const StaticValue* QV4::CompiledData::CompilationUnit::constants = nullptr

Definition at line 1478 of file qv4compileddata_p.h.

Referenced by ~CompilationUnit(), bindingValueAsNumber(), and setUnitData().

◆ data

const Unit* QV4::CompiledData::CompilationUnit::data = nullptr

Definition at line 1472 of file qv4compileddata_p.h.

Referenced by saveToDisk(), and unitData().

◆ dependentScripts

QVector<QQmlRefPointer<QQmlScriptData> > QV4::CompiledData::CompilationUnit::dependentScripts

Definition at line 1501 of file qv4compileddata_p.h.

Referenced by QQmlTypeData::done().

◆ dynamicStrings

QStringList QV4::CompiledData::CompilationUnit::dynamicStrings

Definition at line 1474 of file qv4compileddata_p.h.

Referenced by loadFromDisk(), and stringAt().

◆ icRootName

std::unique_ptr<QString> QV4::CompiledData::CompilationUnit::icRootName

◆ inlineComponentData

QHash<QString, InlineComponentData> QV4::CompiledData::CompilationUnit::inlineComponentData

◆ m_totalBindingsCount

int QV4::CompiledData::CompilationUnit::m_totalBindingsCount = 0

Definition at line 1482 of file qv4compileddata_p.h.

Referenced by totalBindingsCount().

◆ m_totalObjectCount

int QV4::CompiledData::CompilationUnit::m_totalObjectCount = 0

Definition at line 1484 of file qv4compileddata_p.h.

Referenced by totalObjectCount().

◆ m_totalParserStatusCount

int QV4::CompiledData::CompilationUnit::m_totalParserStatusCount = 0

Definition at line 1483 of file qv4compileddata_p.h.

Referenced by totalParserStatusCount().

◆ propertyCaches

QQmlPropertyCacheVector QV4::CompiledData::CompilationUnit::propertyCaches

Definition at line 1497 of file qv4compileddata_p.h.

Referenced by rootPropertyCache().

◆ qmlData

const QmlUnit* QV4::CompiledData::CompilationUnit::qmlData = nullptr

◆ qmlType

QQmlType QV4::CompiledData::CompilationUnit::qmlType

Definition at line 1499 of file qv4compileddata_p.h.

Referenced by metaType(), and qmlTypeForComponent().

◆ resolvedTypes

ResolvedTypeReferenceMap QV4::CompiledData::CompilationUnit::resolvedTypes

◆ typeNameCache

QQmlRefPointer<QQmlTypeNameCache> QV4::CompiledData::CompilationUnit::typeNameCache

Definition at line 1495 of file qv4compileddata_p.h.

Referenced by QQmlTypeData::done().


The documentation for this struct was generated from the following files: