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
QQmlJS::Dom::DomUniverse Class Referencefinal

Represents a set of parsed/loaded modules libraries and a plugins. More...

#include <qqmldomtop_p.h>

+ Inheritance diagram for QQmlJS::Dom::DomUniverse:
+ Collaboration diagram for QQmlJS::Dom::DomUniverse:

Classes

struct  LoadResult
 

Public Member Functions

DomType kind () const override
 
 DomUniverse (const QString &universeName)
 
 DomUniverse (const DomUniverse &)=delete
 
Path canonicalPath () const override
 
bool iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override
 
std::shared_ptr< DomUniversemakeCopy (const DomItem &self) const
 
LoadResult loadFile (const FileToLoad &file, DomType fileType, DomCreationOptions creationOptions={})
 
void removePath (const QString &dir)
 
std::shared_ptr< ExternalItemPair< GlobalScope > > globalScopeWithName (const QString &name) const
 
std::shared_ptr< ExternalItemPair< GlobalScope > > ensureGlobalScopeWithName (const QString &name)
 
QSet< QStringglobalScopeNames () const
 
std::shared_ptr< ExternalItemPair< QmlDirectory > > qmlDirectoryWithPath (const QString &path) const
 
QSet< QStringqmlDirectoryPaths () const
 
std::shared_ptr< ExternalItemPair< QmldirFile > > qmldirFileWithPath (const QString &path) const
 
QSet< QStringqmldirFilePaths () const
 
std::shared_ptr< ExternalItemPair< QmlFile > > qmlFileWithPath (const QString &path) const
 
QSet< QStringqmlFilePaths () const
 
std::shared_ptr< ExternalItemPair< JsFile > > jsFileWithPath (const QString &path) const
 
QSet< QStringjsFilePaths () const
 
std::shared_ptr< ExternalItemPair< QmltypesFile > > qmltypesFileWithPath (const QString &path) const
 
QSet< QStringqmltypesFilePaths () const
 
QString name () const
 
virtual Path canonicalPath () const=0
 
Path canonicalPath (const DomItem &) const override
 QQml::Dom::DomTop::loadFile.
 
- Public Member Functions inherited from QQmlJS::Dom::DomTop
 DomTop (QMap< QString, OwnerT > extraOwningItems={}, int derivedFrom=0)
 
 DomTop (const DomTop &o)
 
DomItem containingObject (const DomItem &) const override
 
template<typename T >
void setExtraOwningItem (const QString &fieldName, const std::shared_ptr< T > &item)
 
void clearExtraOwningItems ()
 
QMap< QString, OwnerTextraOwningItems () const
 
- Public Member Functions inherited from QQmlJS::Dom::OwningItem
 OwningItem (const OwningItem &o)
 
 OwningItem (int derivedFrom=0)
 
 OwningItem (int derivedFrom, const QDateTime &lastDataUpdateAt)
 
 OwningItem (const OwningItem &&)=delete
 
OwningItemoperator= (const OwningItem &&)=delete
 
bool iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override
 
std::shared_ptr< OwningItemmakeCopy (const DomItem &self) const
 
Path pathFromOwner () const
 
Path pathFromOwner (const DomItem &) const override final
 
DomItem containingObject (const DomItem &self) const override
 
int derivedFrom () const
 
virtual int revision () const
 
QDateTime createdAt () const
 
virtual QDateTime lastDataUpdateAt () const
 
virtual void refreshedDataAt (QDateTime tNew)
 
virtual bool frozen () const
 
virtual bool freeze ()
 
QDateTime frozenAt () const
 
virtual void addError (const DomItem &self, ErrorMessage &&msg)
 
void addErrorLocal (ErrorMessage &&msg)
 
void clearErrors (const ErrorGroups &groups=ErrorGroups({}))
 
bool iterateErrors (const DomItem &self, function_ref< bool(const DomItem &source, const ErrorMessage &msg)> visitor, const Path &inPath=Path())
 
QMultiMap< Path, ErrorMessagelocalErrors () const
 
virtual bool iterateSubOwners (const DomItem &self, function_ref< bool(const DomItem &owner)> visitor)
 
QBasicMutexmutex () const
 
- Public Member Functions inherited from QQmlJS::Dom::DomBase
virtual ~DomBase ()=default
 
DomBasedomBase ()
 
const DomBasedomBase () const
 
virtual DomKind domKind () const
 
bool iterateDirectSubpathsConst (const DomItem &self, DirectVisitor) const
 
virtual void dump (const DomItem &, const Sink &sink, int indent, FilterT filter) const
 
virtual quintptr id () const
 
QString typeName () const
 
virtual QList< QStringfields (const DomItem &self) const
 
virtual DomItem field (const DomItem &self, QStringView name) const
 
virtual index_type indexes (const DomItem &self) const
 
virtual DomItem index (const DomItem &self, index_type index) const
 
virtual QSet< QString > const keys (const DomItem &self) const
 
virtual DomItem key (const DomItem &self, const QString &name) const
 
virtual QString canonicalFilePath (const DomItem &self) const
 
virtual void writeOut (const DomItem &self, OutWriter &lw) const
 
virtual QCborValue value () const
 

Static Public Member Functions

static ErrorGroups myErrors ()
 
static std::shared_ptr< DomUniverseguaranteeUniverse (const std::shared_ptr< DomUniverse > &univ)
 
static DomItem create (const QString &universeName)
 
- Static Public Member Functions inherited from QQmlJS::Dom::OwningItem
static int nextRevision ()
 

Static Public Attributes

static constexpr DomType kindValue = DomType::DomUniverse
 

Protected Member Functions

std::shared_ptr< OwningItemdoCopy (const DomItem &self) const override
 

Additional Inherited Members

- Public Types inherited from QQmlJS::Dom::DomTop
using Callback = DomItem::Callback
 
- Public Types inherited from QQmlJS::Dom::DomBase
using FilterT = function_ref<bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)>
 

Detailed Description

Represents a set of parsed/loaded modules libraries and a plugins.

This can be used to share parsing and updates between several Dom models, and kickstart a model without reparsing everything.

The universe is peculiar, because stepping into it from an environment looses the connection with the environment.

This implementation is a placeholder, a later patch will introduce it.

Definition at line 173 of file qqmldomtop_p.h.

Constructor & Destructor Documentation

◆ DomUniverse() [1/2]

QQmlJS::Dom::DomUniverse::DomUniverse ( const QString & universeName)

Definition at line 124 of file qqmldomtop.cpp.

◆ DomUniverse() [2/2]

QQmlJS::Dom::DomUniverse::DomUniverse ( const DomUniverse & )
delete

Member Function Documentation

◆ canonicalPath() [1/3]

Path QQmlJS::Dom::DomUniverse::canonicalPath ( ) const
overridevirtual

Implements QQmlJS::Dom::DomTop.

Definition at line 146 of file qqmldomtop.cpp.

References QQmlJS::Dom::Path::Root().

+ Here is the call graph for this function:

◆ canonicalPath() [2/3]

virtual Path QQmlJS::Dom::DomTop::canonicalPath ( ) const
virtual

Implements QQmlJS::Dom::DomTop.

◆ canonicalPath() [3/3]

Path QQmlJS::Dom::DomTop::canonicalPath ( const DomItem & ) const
overridevirtual

QQml::Dom::DomTop::loadFile.

Parameters
filePaththe file path to load
logicalPaththe path from the
callbacka callback called with an canonical path, the old value, and the current value.
loadOptionsare if force is true the file is always read

Reimplemented from QQmlJS::Dom::DomTop.

Definition at line 153 of file qqmldomtop.cpp.

◆ create()

DomItem QQmlJS::Dom::DomUniverse::create ( const QString & universeName)
static

Definition at line 140 of file qqmldomtop.cpp.

◆ doCopy()

std::shared_ptr< OwningItem > QQmlJS::Dom::DomUniverse::doCopy ( const DomItem & self) const
overrideprotectedvirtual

Implements QQmlJS::Dom::OwningItem.

Definition at line 195 of file qqmldomtop.cpp.

References QRegularExpression::anchoredPattern(), and QStringLiteral.

+ Here is the call graph for this function:

◆ ensureGlobalScopeWithName()

std::shared_ptr< ExternalItemPair< GlobalScope > > QQmlJS::Dom::DomUniverse::ensureGlobalScopeWithName ( const QString & name)
inline

Definition at line 221 of file qqmldomtop_p.h.

References mutex.

◆ globalScopeNames()

QSet< QString > QQmlJS::Dom::DomUniverse::globalScopeNames ( ) const
inline

Definition at line 235 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ globalScopeWithName()

std::shared_ptr< ExternalItemPair< GlobalScope > > QQmlJS::Dom::DomUniverse::globalScopeWithName ( const QString & name) const
inline

Definition at line 215 of file qqmldomtop_p.h.

References mutex.

◆ guaranteeUniverse()

std::shared_ptr< DomUniverse > QQmlJS::Dom::DomUniverse::guaranteeUniverse ( const std::shared_ptr< DomUniverse > & univ)
static

Definition at line 126 of file qqmldomtop.cpp.

References next, and QString::number().

+ Here is the call graph for this function:

◆ iterateDirectSubpaths()

bool QQmlJS::Dom::DomUniverse::iterateDirectSubpaths ( const DomItem & self,
DirectVisitor visitor ) const
overridevirtual

Reimplemented from QQmlJS::Dom::DomTop.

Definition at line 151 of file qqmldomtop.cpp.

◆ jsFilePaths()

QSet< QString > QQmlJS::Dom::DomUniverse::jsFilePaths ( ) const
inline

Definition at line 295 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ jsFileWithPath()

std::shared_ptr< ExternalItemPair< JsFile > > QQmlJS::Dom::DomUniverse::jsFileWithPath ( const QString & path) const
inline

Definition at line 290 of file qqmldomtop_p.h.

References mutex.

◆ kind()

DomType QQmlJS::Dom::DomUniverse::kind ( ) const
inlineoverridevirtual

Implements QQmlJS::Dom::DomBase.

Definition at line 183 of file qqmldomtop_p.h.

◆ loadFile()

DomUniverse::LoadResult QQmlJS::Dom::DomUniverse::loadFile ( const FileToLoad & file,
DomType fileType,
DomCreationOptions creationOptions = {} )

Definition at line 235 of file qqmldomtop.cpp.

References arg, QQmlJS::Dom::domTypeToString(), error, file, fileType(), QQmlJS::Dom::JsFile, myErrors(), Q_ASSERT, QQmlJS::Dom::QmlDirectory, QQmlJS::Dom::QmldirFile, QQmlJS::Dom::QmlFile, QQmlJS::Dom::QmltypesFile, and tr.

+ Here is the call graph for this function:

◆ makeCopy()

std::shared_ptr< DomUniverse > QQmlJS::Dom::DomUniverse::makeCopy ( const DomItem & self) const
inline

Definition at line 195 of file qqmldomtop_p.h.

◆ myErrors()

ErrorGroups QQmlJS::Dom::DomUniverse::myErrors ( )
static

Definition at line 118 of file qqmldomtop.cpp.

References QQmlJS::Dom::DomItem::domErrorGroup, and NewErrorGroup.

Referenced by QQmlJS::Dom::fileTypeForPath(), and loadFile().

+ Here is the caller graph for this function:

◆ name()

QString QQmlJS::Dom::DomUniverse::name ( ) const
inline

Definition at line 320 of file qqmldomtop_p.h.

◆ qmlDirectoryPaths()

QSet< QString > QQmlJS::Dom::DomUniverse::qmlDirectoryPaths ( ) const
inline

Definition at line 250 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ qmlDirectoryWithPath()

std::shared_ptr< ExternalItemPair< QmlDirectory > > QQmlJS::Dom::DomUniverse::qmlDirectoryWithPath ( const QString & path) const
inline

Definition at line 245 of file qqmldomtop_p.h.

References mutex.

◆ qmldirFilePaths()

QSet< QString > QQmlJS::Dom::DomUniverse::qmldirFilePaths ( ) const
inline

Definition at line 265 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ qmldirFileWithPath()

std::shared_ptr< ExternalItemPair< QmldirFile > > QQmlJS::Dom::DomUniverse::qmldirFileWithPath ( const QString & path) const
inline

Definition at line 260 of file qqmldomtop_p.h.

References mutex.

◆ qmlFilePaths()

QSet< QString > QQmlJS::Dom::DomUniverse::qmlFilePaths ( ) const
inline

Definition at line 280 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ qmlFileWithPath()

std::shared_ptr< ExternalItemPair< QmlFile > > QQmlJS::Dom::DomUniverse::qmlFileWithPath ( const QString & path) const
inline

Definition at line 275 of file qqmldomtop_p.h.

References mutex.

◆ qmltypesFilePaths()

QSet< QString > QQmlJS::Dom::DomUniverse::qmltypesFilePaths ( ) const
inline

Definition at line 310 of file qqmldomtop_p.h.

References QMap< Key, T >::keyBegin(), QMap< Key, T >::keyEnd(), map, and mutex.

+ Here is the call graph for this function:

◆ qmltypesFileWithPath()

std::shared_ptr< ExternalItemPair< QmltypesFile > > QQmlJS::Dom::DomUniverse::qmltypesFileWithPath ( const QString & path) const
inline

Definition at line 305 of file qqmldomtop_p.h.

References mutex.

◆ removePath()

void QQmlJS::Dom::DomUniverse::removePath ( const QString & dir)

Definition at line 345 of file qqmldomtop.cpp.

References it, and QQmlJS::Dom::OwningItem::mutex().

+ Here is the call graph for this function:

Member Data Documentation

◆ kindValue

constexpr DomType QQmlJS::Dom::DomUniverse::kindValue = DomType::DomUniverse
staticconstexpr

Definition at line 182 of file qqmldomtop_p.h.


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