![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qqmldompath_p.h>
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(const DomItem &)> | headFilter () const |
Path | head () const |
Path | last () const |
Source | split () const |
Splits the path at the last field, root or current Component. | |
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 | withComponent (const PathEls::PathComponent &c) |
Path | withEmpty () const |
Path | withField (const QString &name) const |
Path | withField (QStringView name) const |
Path | withKey (const QString &name) const |
Path | withKey (QStringView name) const |
Path | withIndex (index_type i) const |
Path | withAny () const |
Path | withFilter (const std::function< bool(const DomItem &)> &, const QString &) const |
Path | withFilter (const std::function< bool(const DomItem &)> &, QStringView desc=u"<native code filter>") const |
Path | withCurrent (PathCurrent s) const |
Path | withCurrent (const QString &s) const |
Path | withCurrent (QStringView s=u"") const |
Path | withPath (const Path &toAdd, bool avoidToAddAsBase=false) const |
Returns a copy of this with toAdd appended to it. | |
Path | expandFront () const |
Expand a path prefix hidden by slicing. | |
Path | expandBack () const |
Expand a path suffix hidden by slicing. | |
Path & | operator++ () |
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 | fromRoot (PathRoot r) |
static Path | fromRoot (QStringView s=u"") |
static Path | fromRoot (const QString &s) |
static Path | fromIndex (index_type i) |
static Path | fromField (QStringView s=u"") |
static Path | fromField (const QString &s) |
static Path | fromKey (QStringView s=u"") |
static Path | fromKey (const QString &s) |
static Path | fromCurrent (PathCurrent c) |
static Path | fromCurrent (QStringView s=u"") |
static Path | fromCurrent (const QString &s) |
static int | cmp (const Path &p1, const Path &p2) |
Friends | |
class | QQmlJS::Dom::PathEls::TestPaths |
class | FieldFilter |
size_t | qHash (const Path &path, size_t seed) |
Definition at line 593 of file qqmldompath_p.h.
Definition at line 598 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::difference_type = long |
Definition at line 670 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::iterator_category = std::forward_iterator_tag |
Definition at line 674 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::Kind = PathEls::Kind |
Definition at line 597 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::pointer = const Component* |
Definition at line 672 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::reference = const Path& |
Definition at line 673 of file qqmldompath_p.h.
using QQmlJS::Dom::Path::value_type = Path |
Definition at line 671 of file qqmldompath_p.h.
|
default |
Referenced by QQmlJS::Dom::Component::Component(), QQmlJS::Dom::DomItem::DomItem(), QQmlJS::Dom::DomItem::DomItem(), QQmlJS::Dom::DomEnvironment::addAllLoadedCallback(), QQmlJS::Dom::Empty::canonicalPath(), QQmlJS::Dom::MutableDomItem::containingObject(), dropFront(), dropTail(), fromString(), QQmlJS::Dom::DomItem::globalScope(), mid(), QQmlJS::Dom::Empty::pathFromOwner(), QQmlJS::Dom::OwningItem::pathFromOwner(), and split().
|
inlineexplicit |
Definition at line 602 of file qqmldompath_p.h.
References withComponent().
Referenced by withComponent().
PathIterator QQmlJS::Dom::Path::begin | ( | ) | const |
Definition at line 316 of file qqmldompath.cpp.
bool QQmlJS::Dom::Path::checkHeadName | ( | QStringView | name | ) | const |
Definition at line 354 of file qqmldompath.cpp.
Definition at line 921 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::PathComponent::cmp().
Referenced by QQmlJS::Dom::ErrorMessage::compare, QQmlJS::Dom::operator!=(), QQmlJS::Dom::operator<(), QQmlJS::Dom::operator<=(), QQmlJS::Dom::operator==(), QQmlJS::Dom::operator>(), and QQmlJS::Dom::operator>=().
Path QQmlJS::Dom::Path::dropFront | ( | int | n = 1 | ) | const |
Definition at line 1054 of file qqmldompath.cpp.
References Path().
Referenced by QQmlJS::Dom::FileLocations::find().
Path QQmlJS::Dom::Path::dropTail | ( | int | n = 1 | ) | const |
Definition at line 1061 of file qqmldompath.cpp.
References Path().
Referenced by QQmlJS::Dom::DomItem::goUp(), QQmlJS::Dom::DomItem::isCanonicalChild(), QQmlJS::Dom::DomItem::visitScopeChain(), and QQmlJS::Dom::DomItem::visitUp().
Definition at line 1031 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::Current, QQmlJS::Dom::PathEls::PathComponent::hasSquareBrackets(), QQmlJS::Dom::PathEls::PathComponent::kind(), and QQmlJS::Dom::PathEls::Root.
PathIterator QQmlJS::Dom::Path::end | ( | ) | const |
Definition at line 321 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::expandBack | ( | ) | const |
Expand a path suffix hidden by slicing.
This sets m_endOffset to 0.
For example, for a path \badcode c -> d when encoded as a -> b -> c -> d -> e -> f -> g, m_endOffset = 3, m_length = 2 expandBack() will return \badcode c -> d -> e -> f -> g when encoded as a -> b -> c -> d -> e -> f -> g, m_endOffset = 0, m_length = 5
Definition at line 899 of file qqmldompath.cpp.
Referenced by withPath().
Path QQmlJS::Dom::Path::expandFront | ( | ) | const |
Expand a path prefix hidden by slicing.
This sets m_length to the maximum length this path can have.
For example, for a path \badcode b -> c -> d when encoded as a -> b -> c -> d -> e -> f, m_endOffset = 2, m_length = 3 expandFront() will return \badcode a -> b -> c -> d when encoded as a -> b -> c -> d -> e -> f, m_endOffset = 2, m_length = 4
Definition at line 872 of file qqmldompath.cpp.
Referenced by withPath().
Definition at line 678 of file qqmldompath.cpp.
|
static |
Definition at line 672 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::Current::Current(), and QQmlJS::Dom::PathEls::PathComponent::PathComponent().
Referenced by QQmlJS::Dom::ModuleScope::iterateDirectSubpaths(), QQmlJS::Dom::Paths::lookupCppTypePath(), QQmlJS::Dom::Paths::lookupPropertyPath(), QQmlJS::Dom::Paths::lookupSymbolPath(), and QQmlJS::Dom::Paths::lookupTypePath().
|
static |
Definition at line 684 of file qqmldompath.cpp.
Definition at line 651 of file qqmldompath.cpp.
|
static |
Definition at line 645 of file qqmldompath.cpp.
|
static |
Definition at line 632 of file qqmldompath.cpp.
Definition at line 665 of file qqmldompath.cpp.
|
static |
Definition at line 657 of file qqmldompath.cpp.
Definition at line 626 of file qqmldompath.cpp.
Definition at line 620 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::PathComponent::PathComponent(), and QQmlJS::Dom::PathEls::Root::Root().
Referenced by QQmlJS::Dom::DomEnvironment::canonicalPath(), 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().
|
static |
Definition at line 638 of file qqmldompath.cpp.
|
static |
Definition at line 1082 of file qqmldompath.cpp.
|
static |
Definition at line 399 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::Any::Any(), Path(), QQmlJS::Dom::PathEls::PathComponent::PathComponent(), QQmlJS::Dom::PathEls::PathComponent::PathComponent(), QQmlJS::Dom::PathEls::End, QQmlJS::Dom::ErrorGroups::error(), QQmlJS::Dom::PathEls::IndexOrKey, myErrors(), QQmlJS::Dom::PathEls::Start, and QQmlJS::Dom::ErrorGroups::warning().
Path QQmlJS::Dom::Path::head | ( | ) | const |
Definition at line 373 of file qqmldompath.cpp.
References mid().
Referenced by QQmlJS::Dom::FileLocations::find().
PathCurrent QQmlJS::Dom::Path::headCurrent | ( | ) | const |
Definition at line 334 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::PathComponent::asCurrent(), QQmlJS::Dom::PathEls::Current::contextKind, and QQmlJS::Dom::Other.
Referenced by QQmlJS::Dom::DomItem::resolve().
Definition at line 364 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::PathComponent::asFilter().
Referenced by QQmlJS::Dom::DomItem::resolve().
index_type QQmlJS::Dom::Path::headIndex | ( | index_type | defaultValue = -1 | ) | const |
Definition at line 359 of file qqmldompath.cpp.
Path::Kind QQmlJS::Dom::Path::headKind | ( | ) | const |
Definition at line 342 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::Empty, and QQmlJS::Dom::PathEls::PathComponent::kind().
Referenced by QQmlJS::Dom::DomItem::canonicalPath(), qHash, and QQmlJS::Dom::DomItem::resolve().
QString QQmlJS::Dom::Path::headName | ( | ) | const |
Definition at line 349 of file qqmldompath.cpp.
PathRoot QQmlJS::Dom::Path::headRoot | ( | ) | const |
Definition at line 326 of file qqmldompath.cpp.
References QQmlJS::Dom::PathEls::PathComponent::asRoot(), QQmlJS::Dom::PathEls::Root::contextKind, and QQmlJS::Dom::Other.
Referenced by QQmlJS::Dom::DomItem::resolve().
Path QQmlJS::Dom::Path::last | ( | ) | const |
Definition at line 378 of file qqmldompath.cpp.
Referenced by QQmlJS::Dom::QmlObject::addBinding(), QQmlJS::Dom::QmlObject::addMethod(), QQmlJS::Dom::QmlObject::addPropertyDef(), QQmlJS::Dom::QmlObject::orderOfAttributes(), QQmlJS::Dom::FileLocations::treeOf(), and QQmlJS::Dom::EnumItem::writeOut().
|
inline |
Definition at line 607 of file qqmldompath_p.h.
Referenced by QQmlJS::Dom::ErrorGroups::fatal(), QQmlJS::Dom::DomItem::goUp(), QQmlJS::Dom::OwningItem::iterateErrors(), QQmlJS::Dom::ExternalItemInfoBase::lastRevision(), QQmlJS::Dom::ExternalItemInfoBase::lastValidRevision(), operator bool(), QQmlJS::Dom::operator!=(), QQmlJS::Dom::operator==(), qHash, QQmlJS::Dom::DomItem::resolve(), split(), QQmlJS::Dom::DomItem::visitUp(), and withPath().
Path QQmlJS::Dom::Path::mid | ( | int | offset | ) | const |
Definition at line 1077 of file qqmldompath.cpp.
Referenced by split().
Path QQmlJS::Dom::Path::mid | ( | int | offset, |
int | length ) const |
Definition at line 1068 of file qqmldompath.cpp.
References Path().
Referenced by head(), QQmlJS::Dom::ExternalItemInfoBase::lastRevision(), QQmlJS::Dom::ExternalItemInfoBase::lastValidRevision(), operator[](), QQmlJS::Dom::DomItem::resolve(), split(), and withPath().
|
static |
Definition at line 1025 of file qqmldompath.cpp.
Referenced by fromString().
|
explicit |
Definition at line 311 of file qqmldompath.cpp.
References length().
Path & QQmlJS::Dom::Path::operator++ | ( | ) |
Definition at line 906 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::operator++ | ( | int | ) |
Definition at line 913 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::operator[] | ( | int | i | ) | const |
Definition at line 306 of file qqmldompath.cpp.
References mid().
Referenced by qHash, QQmlJS::Dom::DomItem::resolve(), and QQmlJS::Dom::QmlComponent::subComponentsNames().
Source QQmlJS::Dom::Path::split | ( | ) | const |
Splits the path at the last field, root or current Component.
Definition at line 387 of file qqmldompath.cpp.
References Path(), QQmlJS::Dom::PathEls::Current, QQmlJS::Dom::PathEls::Field, QQmlJS::Dom::PathEls::PathComponent::kind(), length(), mid(), mid(), and QQmlJS::Dom::PathEls::Root.
Referenced by QQmlJS::Dom::DomItem::container(), QQmlJS::Dom::DomBase::containingObject(), and QQmlJS::Dom::OwningItem::containingObject().
QString QQmlJS::Dom::Path::toString | ( | ) | const |
Definition at line 1045 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::withAny | ( | ) | const |
Definition at line 734 of file qqmldompath.cpp.
References withAny().
Referenced by withAny().
Path QQmlJS::Dom::Path::withComponent | ( | const PathEls::PathComponent & | c | ) |
Definition at line 965 of file qqmldompath.cpp.
References Path(), QQmlJS::Dom::PathEls::Any, QQmlJS::Dom::PathEls::PathComponent::asCurrent(), QQmlJS::Dom::PathEls::PathComponent::asFilter(), QQmlJS::Dom::PathEls::PathComponent::asRoot(), QQmlJS::Dom::PathEls::Current::contextKind, QQmlJS::Dom::PathEls::Root::contextKind, 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::PathEls::PathComponent::kind(), QQmlJS::Dom::Other, QQmlJS::Dom::PathEls::Root, and withComponent().
Referenced by Path(), QQmlJS::Dom::keyMultiMapHelper(), withComponent(), and QQmlJS::Dom::DomItem::wrap().
Definition at line 763 of file qqmldompath.cpp.
References withCurrent().
Path QQmlJS::Dom::Path::withCurrent | ( | PathCurrent | s | ) | const |
Definition at line 757 of file qqmldompath.cpp.
Referenced by withCurrent(), and withCurrent().
Path QQmlJS::Dom::Path::withCurrent | ( | QStringView | s = u"" | ) | const |
Definition at line 770 of file qqmldompath.cpp.
References withCurrent().
Path QQmlJS::Dom::Path::withEmpty | ( | ) | const |
Definition at line 690 of file qqmldompath.cpp.
References withEmpty().
Referenced by withEmpty().
Definition at line 698 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::withField | ( | QStringView | name | ) | const |
Definition at line 705 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::withFilter | ( | const std::function< bool(const DomItem &)> & | , |
const QString & | ) const |
Path QQmlJS::Dom::Path::withFilter | ( | const std::function< bool(const DomItem &)> & | , |
QStringView | desc = u"<native code filter>" ) const |
Path QQmlJS::Dom::Path::withIndex | ( | index_type | i | ) | const |
Definition at line 726 of file qqmldompath.cpp.
Definition at line 713 of file qqmldompath.cpp.
Path QQmlJS::Dom::Path::withKey | ( | QStringView | name | ) | const |
Definition at line 721 of file qqmldompath.cpp.
Returns a copy of this with toAdd
appended to it.
Compresses toAdd
into one vector of components before adding it to this
.
Definition at line 819 of file qqmldompath.cpp.
References expandBack(), expandFront(), length(), mid(), QQmlJS::Dom::operator==(), and withPath().
Referenced by QQmlJS::Dom::AstRangesVisitor::addItemRanges(), QQmlJS::Dom::ModuleScope::canonicalPath(), QQmlJS::Dom::FileLocations::treeOf(), and withPath().
|
friend |
Definition at line 683 of file qqmldompath_p.h.
|
friend |
Definition at line 734 of file qqmldompath_p.h.
References headKind(), length(), and operator[]().
|
friend |
Definition at line 682 of file qqmldompath_p.h.