KItinerary
extractorscriptengine.cpp
64 d->m_engine.globalObject().setProperty(QStringLiteral("JsonLd"), d->m_engine.newQObject(d->m_jsonLdApi));
66 d->m_engine.globalObject().setProperty(QStringLiteral("Barcode"), d->m_engine.newQObject(d->m_barcodeApi));
67 d->m_engine.globalObject().setProperty(QStringLiteral("ByteArray"), d->m_engine.newQObject(new JsApi::ByteArray));
69 d->m_engine.globalObject().setProperty(QStringLiteral("ExtractorEngine"), d->m_engine.newQObject(d->m_engineApi));
76 QObject::connect(d->m_watchdogTimer, &QTimer::timeout, &d->m_engine, [this]() { d->m_engine.setInterrupted(true); }, Qt::DirectConnection);
99 qCWarning(Log).noquote().nospace() << "JS ERROR: [" << (fileName.isString() ? fileName.toString() : fileNameToUrl(fileNameFallback))
106 // we cannot do this unconditionally however without breaking KItinerary Workbench's live editing
126ExtractorResult ExtractorScriptEngine::execute(const ScriptExtractor *extractor, const ExtractorDocumentNode &node, const ExtractorDocumentNode &triggerNode) const
147 qCDebug(Log) << "Running script extractor" << extractor->scriptFileName() << extractor->scriptFunction();
A node in the extracted document object tree.
Definition extractordocumentnode.h:50
QDateTime contextDateTime
The best known context date/time at this point in the document tree.
Definition extractordocumentnode.h:68
const BarcodeDecoder * barcodeDecoder() const
Barcode decoder for use by KItinerary::ExtractorDocumentProcessor.
Definition engine/extractorengine.cpp:177
API for dealing with QByteArray and/or JS ArrayBuffer objects.
Definition bytearray.h:21
API to access the extractor engine for JS extractor scripts.
Definition jsapi/extractorengine.h:19
A single unstructured data extraction rule set.
Definition scriptextractor.h:77
QString scriptFunction() const
The JS function entry point for this extractor, main if empty.
Definition scriptextractor.cpp:129
QString scriptFileName() const
The JS script containing the code of the extractor.
Definition scriptextractor.cpp:119
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
ReadOnly
ConsoleExtension
QJSValue evaluate(const QString &program, const QString &fileName, int lineNumber, QStringList *exceptionStackTrace)
void push_back(const QJsonValue &value)
QJsonValue fromVariant(const QVariant &variant)
QJSValue call(const QJSValueList &args) const const
bool isArray() const const
bool isError() const const
bool isObject() const const
QJSValue property(const QString &name) const const
qint32 toInt() const const
QString toString() const const
QVariant toVariant() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
bool setProperty(const char *name, QVariant &&value)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QStringView mid(qsizetype start, qsizetype length) const const
DirectConnection
void quit()
bool wait(QDeadlineTimer deadline)
void setInterval(int msec)
void start()
void stop()
void timeout()
QUrl fromLocalFile(const QString &localFile)
QString toString(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:00:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:00:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.