KItinerary
extractorfilter.cpp
103 return !d->m_mimeType.isEmpty() && (!d->m_fieldName.isEmpty() || !needsFieldName(d->m_mimeType)) && d->m_exp.isValid();
158static bool filterMachesNode(const ExtractorFilter &filter, ExtractorFilter::Scope scope, const ExtractorDocumentNode &node,
166 if (filter.mimeType() == node.mimeType() && ((filter.fieldName().isEmpty() && filter.pattern().isEmpty()) || node.processor()->matches(filter, node))) {
173 if (scope != ExtractorFilter::Ancestors && filter.mimeType() == "application/ld+json"_L1 && !node.result().isEmpty()) {
179 descendantsMatched |= filterMachesNode(filter, ExtractorFilter::Descendants, child, matches, matchMode);
204 const auto m = filterMachesNode(filter, ExtractorFilter::Descendants, child, matches, matchMode);
227 if (filterMachesNode(*this, d->m_scope == ExtractorFilter::Descendants ? d->m_scope : ExtractorFilter::Current, child, matches, Any)) {
235void ExtractorFilter::allMatches(const ExtractorDocumentNode &node, std::vector<ExtractorDocumentNode>& matches) const
250 filterMachesNode(*this, d->m_scope == ExtractorFilter::Descendants ? d->m_scope : ExtractorFilter::Current, child, matches, All);
A node in the extracted document object tree.
Definition extractordocumentnode.h:50
KItinerary::ExtractorDocumentNode parent
The parent node, or a null node if this is the root node.
Definition extractordocumentnode.h:55
Determines whether an extractor is applicable to a given email.
Definition extractorfilter.h:24
QString mimeType() const
MIME type of the document part this filter can match.
Definition extractorfilter.cpp:43
void allMatches(const ExtractorDocumentNode &node, std::vector< ExtractorDocumentNode > &matches) const
Checks whether this filter applies to node.
Definition extractorfilter.cpp:235
bool matches(const QString &data) const
Check if data matches this filter.
Definition extractorfilter.cpp:65
Scope
Specifies which document nodes should match this filter, relative to the one being extracted.
Definition extractorfilter.h:44
Scope scope() const
Evaluation scope of this filter, in relation to the node being extracted.
Definition extractorfilter.cpp:132
char * toString(const EngineQuery &query)
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
const char * constData() const const
bool isEmpty() const const
iterator insert(QLatin1StringView key, const QJsonValue &value)
QJsonValue value(QLatin1StringView key) const const
bool isObject() const const
bool isString() const const
QJsonObject toObject() const const
QString toString() const const
QJSValue property(const QString &name) const const
QMetaEnum fromType()
QByteArray toUtf8() const const
QList< QStringView > split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.