KItinerary::ExtractorDocumentProcessor
#include <extractordocumentprocessor.h>
Public Member Functions | |
virtual bool | canHandleData (const QByteArray &encodedData, QStringView fileName) const |
virtual QJSValue | contentToScriptValue (const ExtractorDocumentNode &node, QJSEngine *engine) const |
virtual ExtractorDocumentNode | createNodeFromContent (const QVariant &decodedData) const |
virtual ExtractorDocumentNode | createNodeFromData (const QByteArray &encodedData) const |
virtual void | destroyNode (ExtractorDocumentNode &node) const |
virtual void | expandNode (ExtractorDocumentNode &node, const ExtractorEngine *engine) const |
virtual bool | matches (const ExtractorFilter &filter, const ExtractorDocumentNode &node) const |
virtual void | postExtract (ExtractorDocumentNode &node, const ExtractorEngine *engine) const |
virtual void | preExtract (ExtractorDocumentNode &node, const ExtractorEngine *engine) const |
virtual void | reduceNode (ExtractorDocumentNode &node) const |
Protected Member Functions | |
template<typename T > | |
void | destroyIfOwned (ExtractorDocumentNode &node) const |
Static Protected Member Functions | |
static bool | matchesGadget (const ExtractorFilter &filter, const QMetaObject *mo, const void *obj) |
template<typename T > | |
static bool | matchesGadget (const ExtractorFilter &filter, const T *obj) |
Detailed Description
Abstract base class of a document type processor.
Definition at line 23 of file extractordocumentprocessor.h.
Member Function Documentation
◆ canHandleData()
|
virtual |
Fast check whether the given encoded data can possibly be processed by this instance.
The default implementation returns false, relying on QMimeDatabase for detection.
Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::ElbDocumentProcessor, KItinerary::ExternalProcessor, KItinerary::HarDocumentProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalCalendarProcessor, KItinerary::JsonLdDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, KItinerary::PkPassDocumentProcessor, KItinerary::PListDocumentProcessor, KItinerary::SsbDocumentProcessor, KItinerary::TextDocumentProcessor, KItinerary::Uic9183DocumentProcessor, and KItinerary::VdvDocumentProcessor.
Definition at line 20 of file extractordocumentprocessor.cpp.
◆ contentToScriptValue()
|
virtual |
Create a QJSValue for the node content.
The default implementation is sufficient if the content is a QObject pointer, QGadget value, or any built-in type.
Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.
Definition at line 107 of file extractordocumentprocessor.cpp.
◆ createNodeFromContent()
|
virtual |
Create a document node from an already decoded data type.
The default implementation just sets decodedData
on the resulting node.
Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.
Definition at line 30 of file extractordocumentprocessor.cpp.
◆ createNodeFromData()
|
virtual |
Create a document node from raw data.
The default implementation produces in invalid node.
Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::ElbDocumentProcessor, KItinerary::ExternalProcessor, KItinerary::HarDocumentProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalCalendarProcessor, KItinerary::ImageDocumentProcessor, KItinerary::JsonLdDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, KItinerary::PkPassDocumentProcessor, KItinerary::PListDocumentProcessor, KItinerary::SsbDocumentProcessor, KItinerary::TextDocumentProcessor, KItinerary::Uic9183DocumentProcessor, and KItinerary::VdvDocumentProcessor.
Definition at line 25 of file extractordocumentprocessor.cpp.
◆ destroyIfOwned()
|
inlineprotected |
Definition at line 80 of file extractordocumentprocessor.h.
◆ destroyNode()
|
virtual |
Destroys type-specific data in node
.
The default implementation does nothing.
Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, and KItinerary::PkPassDocumentProcessor.
Definition at line 112 of file extractordocumentprocessor.cpp.
◆ expandNode()
|
virtual |
Create child nodes for node
, as far as that's necessary for this document type.
Reimplemented in KItinerary::HarDocumentProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::HttpResponseProcessor, KItinerary::IcalCalendarProcessor, KItinerary::IcalEventProcessor, KItinerary::ImageDocumentProcessor, KItinerary::MimeDocumentProcessor, KItinerary::PdfDocumentProcessor, KItinerary::PkPassDocumentProcessor, KItinerary::PListDocumentProcessor, and KItinerary::Uic9183DocumentProcessor.
Definition at line 37 of file extractordocumentprocessor.cpp.
◆ matches()
|
virtual |
Checks whether the given filter
matches node
.
The default implementation can handle QObject and Q_GADGET types via Qt's property system.
Reimplemented in KItinerary::BinaryDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::MimeDocumentProcessor, and KItinerary::TextDocumentProcessor.
Definition at line 55 of file extractordocumentprocessor.cpp.
◆ matchesGadget() [1/2]
|
staticprotected |
Definition at line 98 of file extractordocumentprocessor.cpp.
◆ matchesGadget() [2/2]
|
inlinestaticprotected |
Definition at line 87 of file extractordocumentprocessor.h.
◆ postExtract()
|
virtual |
Called after extractors have been applied to node
.
This can be used for applying document type specific data to the extracted result. The default implementation does nothing.
Reimplemented in KItinerary::HtmlDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::PdfDocumentProcessor, KItinerary::PkPassDocumentProcessor, and KItinerary::TextDocumentProcessor.
Definition at line 103 of file extractordocumentprocessor.cpp.
◆ preExtract()
|
virtual |
Called before extractors are applied to node
.
This can be used for performing document type specific extraction steps. The default implementation does nothing.
Reimplemented in KItinerary::ExternalProcessor, KItinerary::HtmlDocumentProcessor, KItinerary::IataBcbpDocumentProcessor, KItinerary::IcalEventProcessor, KItinerary::JsonLdDocumentProcessor, KItinerary::PkPassDocumentProcessor, KItinerary::SsbDocumentProcessor, KItinerary::Uic9183DocumentProcessor, and KItinerary::VdvDocumentProcessor.
Definition at line 51 of file extractordocumentprocessor.cpp.
◆ reduceNode()
|
virtual |
Propagate results from child nodes up to node
.
The default implementation just appends results.
Definition at line 41 of file extractordocumentprocessor.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.