Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJS::Dom::Path Class Reference

#include <qqmldompath_p.h>

+ Collaboration diagram for QQmlJS::Dom::Path:

Public Types

using Kind = PathEls::Kind
 
using Component = PathEls::PathComponent
 
using difference_type = long
 
using value_type = Path
 
using pointer = const Component *
 
using reference = const Path &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 Path ()=default
 
 Path (const PathEls::PathComponent &c)
 
int length () const
 
Path operator[] (int i) const
 
 operator bool () const
 
PathIterator begin () const
 
PathIterator end () const
 
PathRoot headRoot () const
 
PathCurrent headCurrent () const
 
Kind headKind () const
 
QString headName () const
 
bool checkHeadName (QStringView name) const
 
index_type headIndex (index_type defaultValue=-1) const
 
std::function< bool(DomItem)> headFilter () const
 
Path head () const
 
Path last () const
 
Source split () const
 
void dump (Sink sink) const
 
QString toString () const
 
Path dropFront (int n=1) const
 
Path dropTail (int n=1) const
 
Path mid (int offset, int length) const
 
Path mid (int offset) const
 
Path appendComponent (const PathEls::PathComponent &c)
 
Path empty () const
 
Path field (QString name) const
 
Path field (QStringView name) const
 
Path key (QString name) const
 
Path key (QStringView name) const
 
Path index (index_type i) const
 
Path any () const
 
Path filter (std::function< bool(DomItem)>, QString) const
 
Path filter (std::function< bool(DomItem)>, QStringView desc=u"<native code filter>") const
 
Path current (PathCurrent s) const
 
Path current (QString s) const
 
Path current (QStringView s=u"") const
 
Path path (Path toAdd, bool avoidToAddAsBase=false) const
 
Path expandFront () const
 
Path expandBack () const
 
Pathoperator++ ()
 
Path operator++ (int)
 

Static Public Member Functions

static ErrorGroups myErrors ()
 
static Path fromString (QString s, ErrorHandler errorHandler=nullptr)
 
static Path fromString (QStringView s, ErrorHandler errorHandler=nullptr)
 
static Path Root (PathRoot r)
 
static Path Root (QStringView s=u"")
 
static Path Root (QString s)
 
static Path Index (index_type i)
 
static Path Field (QStringView s=u"")
 
static Path Field (QString s)
 
static Path Key (QStringView s=u"")
 
static Path Key (QString s)
 
static Path Current (PathCurrent c)
 
static Path Current (QStringView s=u"")
 
static Path Current (QString s)
 
static Path Empty ()
 
static int cmp (const Path &p1, const Path &p2)
 

Friends

class QQmlJS::Dom::PathEls::TestPaths
 
class FieldFilter
 
size_t qHash (const Path &, size_t)
 

Detailed Description

Definition at line 655 of file qqmldompath_p.h.

Member Typedef Documentation

◆ Component

◆ difference_type

Definition at line 732 of file qqmldompath_p.h.

◆ iterator_category

using QQmlJS::Dom::Path::iterator_category = std::forward_iterator_tag

Definition at line 736 of file qqmldompath_p.h.

◆ Kind

Definition at line 659 of file qqmldompath_p.h.

◆ pointer

Definition at line 734 of file qqmldompath_p.h.

◆ reference

Definition at line 735 of file qqmldompath_p.h.

◆ value_type

Definition at line 733 of file qqmldompath_p.h.

Constructor & Destructor Documentation

◆ Path() [1/2]

QQmlJS::Dom::Path::Path ( )
default

Referenced by any(), Current(), current(), Current(), Current(), current(), dropFront(), dropTail(), Empty(), empty(), expandBack(), expandFront(), Field(), field(), Field(), fromString(), Index(), index(), key(), Key(), Key(), mid(), path(), Root(), Root(), Root(), and split().

+ Here is the caller graph for this function:

◆ Path() [2/2]

QQmlJS::Dom::Path::Path ( const PathEls::PathComponent c)
inlineexplicit

Definition at line 664 of file qqmldompath_p.h.

Member Function Documentation

◆ any()

Path QQmlJS::Dom::Path::any ( ) const

Definition at line 641 of file qqmldompath.cpp.

References Path(), and any().

Referenced by any().

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

◆ appendComponent()

Path QQmlJS::Dom::Path::appendComponent ( const PathEls::PathComponent c)

Definition at line 837 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::Any, appendComponent(), QQmlJS::Dom::PathEls::Current, QQmlJS::Dom::PathEls::Empty, QQmlJS::Dom::PathEls::Field, QQmlJS::Dom::PathEls::Filter, QQmlJS::Dom::PathEls::Index, QQmlJS::Dom::PathEls::Key, QQmlJS::Dom::Other, and QQmlJS::Dom::PathEls::Root.

Referenced by appendComponent().

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

◆ begin()

PathIterator QQmlJS::Dom::Path::begin ( ) const

Definition at line 203 of file qqmldompath.cpp.

◆ checkHeadName()

bool QQmlJS::Dom::Path::checkHeadName ( QStringView  name) const

Definition at line 241 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::PathComponent::checkName().

+ Here is the call graph for this function:

◆ cmp()

int QQmlJS::Dom::Path::cmp ( const Path p1,
const Path p2 
)
static

Definition at line 793 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::PathComponent::cmp(), i, p1, p2, and qMin().

Referenced by QQmlJS::Dom::operator!=(), QQmlJS::Dom::operator<(), QQmlJS::Dom::operator<=(), QQmlJS::Dom::operator==(), QQmlJS::Dom::operator>(), and QQmlJS::Dom::operator>=().

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

◆ Current() [1/3]

Path QQmlJS::Dom::Path::Current ( PathCurrent  c)
static

Definition at line 574 of file qqmldompath.cpp.

References Path().

Referenced by QQmlJS::Dom::Paths::lookupCppTypePath(), QQmlJS::Dom::Paths::lookupPropertyPath(), QQmlJS::Dom::Paths::lookupSymbolPath(), and QQmlJS::Dom::Paths::lookupTypePath().

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

◆ current() [1/3]

Path QQmlJS::Dom::Path::current ( PathCurrent  s) const

Definition at line 664 of file qqmldompath.cpp.

References Path().

Referenced by current(), and current().

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

◆ Current() [2/3]

Path QQmlJS::Dom::Path::Current ( QString  s)
static

Definition at line 580 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ current() [2/3]

Path QQmlJS::Dom::Path::current ( QString  s) const

Definition at line 670 of file qqmldompath.cpp.

References current().

+ Here is the call graph for this function:

◆ Current() [3/3]

Path QQmlJS::Dom::Path::Current ( QStringView  s = u"")
static

Definition at line 586 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ current() [3/3]

Path QQmlJS::Dom::Path::current ( QStringView  s = u"") const

Definition at line 677 of file qqmldompath.cpp.

References Path(), and current().

+ Here is the call graph for this function:

◆ dropFront()

Path QQmlJS::Dom::Path::dropFront ( int  n = 1) const

Definition at line 926 of file qqmldompath.cpp.

References Path().

Referenced by QQmlJS::Dom::AttachedInfo::find(), QQmlJS::Dom::PathIterator::operator++(), and QQmlJS::Dom::PathIterator::operator++().

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

◆ dropTail()

Path QQmlJS::Dom::Path::dropTail ( int  n = 1) const

Definition at line 933 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ dump()

void QQmlJS::Dom::Path::dump ( Sink  sink) const

Definition at line 903 of file qqmldompath.cpp.

References i.

Referenced by QQmlJS::Dom::ErrorGroups::fatal(), and toString().

+ Here is the caller graph for this function:

◆ Empty()

Path QQmlJS::Dom::Path::Empty ( )
static

Definition at line 592 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ empty()

Path QQmlJS::Dom::Path::empty ( ) const

Definition at line 597 of file qqmldompath.cpp.

References Path(), and empty().

Referenced by empty().

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

◆ end()

PathIterator QQmlJS::Dom::Path::end ( ) const

Definition at line 208 of file qqmldompath.cpp.

◆ expandBack()

Path QQmlJS::Dom::Path::expandBack ( ) const

Definition at line 771 of file qqmldompath.cpp.

References Path().

Referenced by path().

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

◆ expandFront()

Path QQmlJS::Dom::Path::expandFront ( ) const

Definition at line 759 of file qqmldompath.cpp.

References Path().

Referenced by path().

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

◆ field() [1/2]

Path QQmlJS::Dom::Path::field ( QString  name) const

Definition at line 605 of file qqmldompath.cpp.

References field().

Referenced by QQmlJS::Dom::RegionComments::addPostComment(), QQmlJS::Dom::RegionComments::addPreComment(), QQmlJS::Dom::ModuleIndex::autoExports(), QQmlJS::Dom::LoadInfo::canonicalPath(), QQmlJS::Dom::domCompare(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::AttachedInfo::ensureItemAtPath(), QQmlJS::Dom::ModuleIndex::exportsWithNameAndMinorVersion(), field(), field(), QQmlJS::Dom::AttachedInfo::findAttachedInfo(), QQmlJS::Dom::Paths::globalScopeInfoPath(), QQmlJS::Dom::Paths::globalScopePath(), QQmlJS::Dom::AttachedInfo::itemAtPath(), QQmlJS::Dom::Paths::jsFileInfoPath(), QQmlJS::Dom::Paths::jsFilePath(), QQmlJS::Dom::Paths::loadInfoPath(), QQmlJS::Dom::Paths::lookupCppTypePath(), QQmlJS::Dom::Paths::lookupPropertyPath(), QQmlJS::Dom::Paths::lookupSymbolPath(), QQmlJS::Dom::Paths::lookupTypePath(), QQmlJS::Dom::Paths::moduleIndexPath(), QQmlJS::Dom::Paths::moduleScopePath(), QQmlJS::Dom::Paths::qmlDirectoryInfoPath(), QQmlJS::Dom::Paths::qmlDirectoryPath(), QQmlJS::Dom::Paths::qmldirFileInfoPath(), QQmlJS::Dom::Paths::qmldirFilePath(), QQmlJS::Dom::Paths::qmlDirInfoPath(), QQmlJS::Dom::Paths::qmlDirPath(), QQmlJS::Dom::Paths::qmlFileInfoPath(), QQmlJS::Dom::Paths::qmlFileObjectPath(), QQmlJS::Dom::Paths::qmlFilePath(), QQmlJS::Dom::Paths::qmltypesFileInfoPath(), QQmlJS::Dom::Paths::qmltypesFilePath(), QQmlJS::Dom::Component::updatePathFromOwner(), QQmlJS::Dom::QmlComponent::updatePathFromOwner(), and QQmlJS::Dom::QQmlDomAstCreator::visit().

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

◆ Field() [1/2]

Path QQmlJS::Dom::Path::Field ( QString  s)
static

Definition at line 553 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ field() [2/2]

Path QQmlJS::Dom::Path::field ( QStringView  name) const

Definition at line 612 of file qqmldompath.cpp.

References Path(), and field().

+ Here is the call graph for this function:

◆ Field() [2/2]

Path QQmlJS::Dom::Path::Field ( QStringView  s = u"")
static

Definition at line 547 of file qqmldompath.cpp.

References Path().

Referenced by QQmlJS::Dom::DomUniverse::canonicalPath(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::DomUniverse::iterateDirectSubpaths(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), and QQmlJS::Dom::QQmlDomAstCreator::visit().

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

◆ filter() [1/2]

Path QQmlJS::Dom::Path::filter ( std::function< bool(DomItem)>  ,
QString   
) const

◆ filter() [2/2]

Path QQmlJS::Dom::Path::filter ( std::function< bool(DomItem)>  ,
QStringView  desc = u"<native code filter>" 
) const

◆ fromString() [1/2]

Path QQmlJS::Dom::Path::fromString ( QString  s,
ErrorHandler  errorHandler = nullptr 
)
static

Definition at line 954 of file qqmldompath.cpp.

References fromString().

Referenced by fromString().

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

◆ fromString() [2/2]

Path QQmlJS::Dom::Path::fromString ( QStringView  s,
ErrorHandler  errorHandler = nullptr 
)
static

◆ head()

Path QQmlJS::Dom::Path::head ( ) const

Definition at line 260 of file qqmldompath.cpp.

References mid().

Referenced by QQmlJS::Dom::AttachedInfo::find(), and QQmlJS::Dom::PathIterator::operator*().

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

◆ headCurrent()

PathCurrent QQmlJS::Dom::Path::headCurrent ( ) const

Definition at line 221 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::Current::asCurrent(), and QQmlJS::Dom::Other.

+ Here is the call graph for this function:

◆ headFilter()

function< bool(DomItem)> QQmlJS::Dom::Path::headFilter ( ) const

Definition at line 251 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::Filter::asFilter(), and function.

+ Here is the call graph for this function:

◆ headIndex()

index_type QQmlJS::Dom::Path::headIndex ( index_type  defaultValue = -1) const

Definition at line 246 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::PathComponent::index().

+ Here is the call graph for this function:

◆ headKind()

Path::Kind QQmlJS::Dom::Path::headKind ( ) const

Definition at line 229 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::PathComponent::kind().

+ Here is the call graph for this function:

◆ headName()

QString QQmlJS::Dom::Path::headName ( ) const

Definition at line 236 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::PathComponent::name().

+ Here is the call graph for this function:

◆ headRoot()

PathRoot QQmlJS::Dom::Path::headRoot ( ) const

Definition at line 213 of file qqmldompath.cpp.

References QQmlJS::Dom::PathEls::Root::asRoot(), and QQmlJS::Dom::Other.

+ Here is the call graph for this function:

◆ Index()

Path QQmlJS::Dom::Path::Index ( index_type  i)
static

Definition at line 534 of file qqmldompath.cpp.

References Path(), and i.

+ Here is the call graph for this function:

◆ index()

Path QQmlJS::Dom::Path::index ( index_type  i) const

Definition at line 633 of file qqmldompath.cpp.

References Path(), i, and index().

Referenced by QQmlJS::Dom::RegionComments::addPostComment(), QQmlJS::Dom::QmlFile::addPragma(), QQmlJS::Dom::RegionComments::addPreComment(), QQmlJS::Dom::EnumDecl::addValue(), QQmlJS::Dom::appendUpdatableElementInQList(), QQmlJS::Dom::domCompare(), index(), QQmlJS::Dom::insertUpdatableElementInMultiMap(), QQmlJS::Dom::Paths::qmlFileObjectPath(), QQmlJS::Dom::updatePathFromOwnerMultiMap(), QQmlJS::Dom::updatePathFromOwnerQList(), QQmlJS::Dom::QQmlDomAstCreator::visit(), and QQmlJS::Dom::QQmlDomAstCreator::visit().

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

◆ key() [1/2]

Path QQmlJS::Dom::Path::key ( QString  name) const

◆ Key() [1/2]

Path QQmlJS::Dom::Path::Key ( QString  s)
static

Definition at line 567 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ key() [2/2]

Path QQmlJS::Dom::Path::key ( QStringView  name) const

Definition at line 628 of file qqmldompath.cpp.

◆ Key() [2/2]

Path QQmlJS::Dom::Path::Key ( QStringView  s = u"")
static

Definition at line 559 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ last()

Path QQmlJS::Dom::Path::last ( ) const

Definition at line 265 of file qqmldompath.cpp.

References mid().

+ Here is the call graph for this function:

◆ length()

int QQmlJS::Dom::Path::length ( ) const
inline

Definition at line 669 of file qqmldompath_p.h.

Referenced by QQmlJS::Dom::ErrorGroups::fatal(), QQmlJS::Dom::OutWriter::itemStart(), mid(), QQmlJS::Dom::operator!=(), QQmlJS::Dom::operator==(), path(), split(), and QQmlJS::Dom::OutWriter::updatedFile().

+ Here is the caller graph for this function:

◆ mid() [1/2]

Path QQmlJS::Dom::Path::mid ( int  offset) const

Definition at line 949 of file qqmldompath.cpp.

References mid().

+ Here is the call graph for this function:

◆ mid() [2/2]

Path QQmlJS::Dom::Path::mid ( int  offset,
int  length 
) const

Definition at line 940 of file qqmldompath.cpp.

References Path(), length(), and qMin().

Referenced by QQmlJS::Dom::AttachedInfo::ensure(), QQmlJS::Dom::AttachedInfo::find(), head(), QQmlJS::Dom::OutWriter::itemStart(), last(), mid(), operator[](), path(), and split().

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

◆ myErrors()

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

Definition at line 897 of file qqmldompath.cpp.

References NewErrorGroup.

Referenced by fromString(), QQmlJS::Dom::Paths::moduleIndexPath(), and QQmlJS::Dom::Paths::moduleScopePath().

+ Here is the caller graph for this function:

◆ operator bool()

QQmlJS::Dom::Path::operator bool ( ) const
explicit

Definition at line 198 of file qqmldompath.cpp.

◆ operator++() [1/2]

Path & QQmlJS::Dom::Path::operator++ ( )

Definition at line 778 of file qqmldompath.cpp.

◆ operator++() [2/2]

Path QQmlJS::Dom::Path::operator++ ( int  )

Definition at line 785 of file qqmldompath.cpp.

◆ operator[]()

Path QQmlJS::Dom::Path::operator[] ( int  i) const

Definition at line 193 of file qqmldompath.cpp.

References i, and mid().

+ Here is the call graph for this function:

◆ path()

Path QQmlJS::Dom::Path::path ( Path  toAdd,
bool  avoidToAddAsBase = false 
) const

Definition at line 685 of file qqmldompath.cpp.

References Path(), expandBack(), expandFront(), i, QQmlJS::Dom::inQString(), QStringView::isEmpty(), j, length(), mid(), path(), and QQmlJS::Dom::PathEls::PathComponent::stringView().

Referenced by QQmlJS::Dom::MutableDomItem::canonicalPath(), path(), QQmlJS::Dom::QQmlDomAstCreator::visit(), and QQmlJS::Dom::AttachedInfoT< Info >::visitTree().

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

◆ Root() [1/3]

Path QQmlJS::Dom::Path::Root ( PathRoot  r)
static

Definition at line 522 of file qqmldompath.cpp.

References Path().

Referenced by QQmlJS::Dom::DomUniverse::canonicalPath(), QQmlJS::Dom::LoadInfo::canonicalPath(), QQmlJS::Dom::Paths::globalScopeInfoPath(), QQmlJS::Dom::Paths::jsFileInfoPath(), QQmlJS::Dom::Paths::loadInfoPath(), QQmlJS::Dom::Paths::moduleIndexPath(), QQmlJS::Dom::Paths::moduleScopePath(), QQmlJS::Dom::Paths::qmlDirectoryInfoPath(), QQmlJS::Dom::Paths::qmldirFileInfoPath(), QQmlJS::Dom::Paths::qmlDirInfoPath(), QQmlJS::Dom::Paths::qmlFileInfoPath(), and QQmlJS::Dom::Paths::qmltypesFileInfoPath().

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

◆ Root() [2/3]

Path QQmlJS::Dom::Path::Root ( QString  s)
static

Definition at line 528 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ Root() [3/3]

Path QQmlJS::Dom::Path::Root ( QStringView  s = u"")
static

Definition at line 540 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ split()

Source QQmlJS::Dom::Path::split ( ) const

Definition at line 270 of file qqmldompath.cpp.

References Path(), i, length(), and mid().

+ Here is the call graph for this function:

◆ toString()

QString QQmlJS::Dom::Path::toString ( ) const

Definition at line 917 of file qqmldompath.cpp.

References dump(), and str.

Referenced by QQmlJS::Dom::OutWriterState::closeState().

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

Friends And Related Symbol Documentation

◆ FieldFilter

friend class FieldFilter
friend

Definition at line 744 of file qqmldompath_p.h.

◆ qHash

size_t qHash ( const Path path,
size_t  seed 
)
friend

Definition at line 795 of file qqmldompath_p.h.

◆ QQmlJS::Dom::PathEls::TestPaths

friend class QQmlJS::Dom::PathEls::TestPaths
friend

Definition at line 743 of file qqmldompath_p.h.


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