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::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
 
Path head () const
 
Path last () const
 
Source split () const
 
void dump (const 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 (const QString &name) const
 
Path field (QStringView name) const
 
Path key (const QString &name) const
 
Path key (QStringView name) const
 
Path index (index_type i) const
 
Path any () const
 
Path filter (const std::function< bool(const DomItem &)> &, const QString &) const
 
Path filter (const std::function< bool(const DomItem &)> &, QStringView desc=u"<native code filter>") const
 
Path current (PathCurrent s) const
 
Path current (const QString &s) const
 
Path current (QStringView s=u"") const
 
Path path (const 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 (const QString &s, const ErrorHandler &errorHandler=nullptr)
 
static Path fromString (QStringView s, const ErrorHandler &errorHandler=nullptr)
 
static Path Root (PathRoot r)
 
static Path Root (QStringView s=u"")
 
static Path Root (const QString &s)
 
static Path Index (index_type i)
 
static Path Field (QStringView s=u"")
 
static Path Field (const QString &s)
 
static Path Key (QStringView s=u"")
 
static Path Key (const QString &s)
 
static Path Current (PathCurrent c)
 
static Path Current (QStringView s=u"")
 
static Path Current (const QString &s)
 
static Path Empty ()
 
static int cmp (const Path &p1, const Path &p2)
 

Public Attributes

std::function< bool(const DomItem &) headFilter )() const
 

Friends

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

Detailed Description

Definition at line 593 of file qqmldompath_p.h.

Member Typedef Documentation

◆ Component

◆ difference_type

Definition at line 671 of file qqmldompath_p.h.

◆ iterator_category

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

Definition at line 675 of file qqmldompath_p.h.

◆ Kind

Definition at line 597 of file qqmldompath_p.h.

◆ pointer

Definition at line 673 of file qqmldompath_p.h.

◆ reference

Definition at line 674 of file qqmldompath_p.h.

◆ value_type

Definition at line 672 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 602 of file qqmldompath_p.h.

Member Function Documentation

◆ any()

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

Definition at line 642 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()

◆ begin()

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

Definition at line 204 of file qqmldompath.cpp.

◆ checkHeadName()

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

Definition at line 242 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 794 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 ( const QString & s)
static

Definition at line 581 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ current() [1/3]

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

Definition at line 671 of file qqmldompath.cpp.

References current().

+ Here is the call graph for this function:

◆ Current() [2/3]

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

Definition at line 575 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() [2/3]

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

Definition at line 665 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() [3/3]

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

Definition at line 587 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 678 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 927 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 934 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ dump()

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

Definition at line 904 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 593 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ empty()

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

Definition at line 598 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 209 of file qqmldompath.cpp.

◆ expandBack()

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

Definition at line 772 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 760 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 ( const QString & name) const

Definition at line 606 of file qqmldompath.cpp.

References field().

Referenced by QQmlJS::Dom::ModuleIndex::autoExports(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::ModuleIndex::exportsWithNameAndMinorVersion(), field(), field(), QQmlJS::Dom::Paths::globalScopePath(), QQmlJS::Dom::Paths::jsFilePath(), QQmlJS::Dom::Paths::qmlDirectoryPath(), QQmlJS::Dom::Paths::qmldirFilePath(), QQmlJS::Dom::Paths::qmlDirPath(), QQmlJS::Dom::Paths::qmlFileObjectPath(), QQmlJS::Dom::Paths::qmlFilePath(), QQmlJS::Dom::Paths::qmltypesFilePath(), 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 ( const QString & s)
static

Definition at line 554 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 613 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 548 of file qqmldompath.cpp.

References Path().

Referenced by QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::AttachedInfo::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 ( const std::function< bool(const DomItem &)> & ,
const QString &  ) const

◆ filter() [2/2]

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

◆ fromString() [1/2]

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

Definition at line 955 of file qqmldompath.cpp.

References fromString().

Referenced by fromString(), and QQmlJS::Dom::AttachedInfo::iterateDirectSubpaths().

+ 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,
const ErrorHandler & errorHandler = nullptr )
static

Definition at line 301 of file qqmldompath.cpp.

References Path(), arg, QString::at(), at, dot(), QQmlJS::Dom::PathEls::End, error, i, QQmlJS::Dom::PathEls::IndexOrKey, myErrors(), QString::number(), ok, Q_ASSERT, quote(), QQmlJS::Dom::PathEls::Start, state, and tr.

+ Here is the call graph for this function:

◆ head()

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

Definition at line 261 of file qqmldompath.cpp.

References mid().

Referenced by 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 222 of file qqmldompath.cpp.

References QQmlJS::Dom::Other.

◆ headIndex()

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

Definition at line 247 of file qqmldompath.cpp.

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

Referenced by QQmlJS::Dom::QQmlDomAstCreator::endVisit().

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

◆ headKind()

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

Definition at line 230 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 237 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 214 of file qqmldompath.cpp.

References QQmlJS::Dom::Other.

◆ Index()

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

Definition at line 535 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 634 of file qqmldompath.cpp.

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

Referenced by QQmlJS::Dom::EnumDecl::addValue(), QQmlJS::Dom::appendUpdatableElementInQList(), index(), QQmlJS::Dom::insertUpdatableElementInMultiMap(), QQmlJS::Dom::Paths::qmlFileObjectPath(), 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 ( const QString & name) const

Definition at line 621 of file qqmldompath.cpp.

References Path(), and key().

Referenced by QQmlJS::Dom::ModuleIndex::exportsWithNameAndMinorVersion(), QQmlJS::Dom::insertUpdatableElementInMultiMap(), key(), QQmlJS::Dom::ModuleScope::pathFromOwner(), QQmlJS::Dom::Paths::qmlFileObjectPath(), and QQmlJS::Dom::updatePathFromOwnerMultiMap().

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

◆ Key() [1/2]

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

Definition at line 568 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 629 of file qqmldompath.cpp.

◆ Key() [2/2]

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

Definition at line 560 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ last()

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

Definition at line 266 of file qqmldompath.cpp.

References mid().

Referenced by QQmlJS::Dom::QQmlDomAstCreator::endVisit().

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

◆ length()

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

Definition at line 607 of file qqmldompath_p.h.

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

+ Here is the caller graph for this function:

◆ mid() [1/2]

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

Definition at line 950 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 941 of file qqmldompath.cpp.

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

Referenced by QQmlJS::Dom::AttachedInfo::ensure(), QQmlJS::Dom::AttachedInfo::ensureItemAtPath(), QQmlJS::Dom::AttachedInfo::find(), head(), QQmlJS::Dom::AttachedInfo::itemAtPath(), last(), mid(), operator[](), path(), split(), 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:

◆ myErrors()

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

Definition at line 898 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 199 of file qqmldompath.cpp.

◆ operator++() [1/2]

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

Definition at line 779 of file qqmldompath.cpp.

◆ operator++() [2/2]

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

Definition at line 786 of file qqmldompath.cpp.

◆ operator[]()

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

Definition at line 194 of file qqmldompath.cpp.

References i, and mid().

+ Here is the call graph for this function:

◆ path()

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

Definition at line 686 of file qqmldompath.cpp.

References Path(), expandBack(), expandFront(), i, QQmlJS::Dom::inQString(), j, length(), mid(), and path().

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 ( const QString & s)
static

Definition at line 529 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ Root() [2/3]

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

Definition at line 523 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() [3/3]

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

Definition at line 541 of file qqmldompath.cpp.

References Path().

+ Here is the call graph for this function:

◆ split()

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

Definition at line 271 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 918 of file qqmldompath.cpp.

References dump(), and str.

Referenced by QQmlJS::Dom::OutWriterState::closeState(), and QQmlJS::Dom::AttachedInfo::iterateDirectSubpaths().

+ 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 684 of file qqmldompath_p.h.

◆ qHash

size_t qHash ( const Path & path,
size_t seed )
friend

Definition at line 735 of file qqmldompath_p.h.

◆ QQmlJS::Dom::PathEls::TestPaths

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

Definition at line 683 of file qqmldompath_p.h.

Member Data Documentation

◆ headFilter

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

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