KItinerary
main.cpp
104 // NOTE: QCoreApplication::applicationDirPath is only valid once QCoreApplication has been created
120 QCommandLineOption capOpt({QStringLiteral("capabilities")}, QStringLiteral("Show available extraction capabilities."));
122 QCommandLineOption listExtOpt({QStringLiteral("list-extractors")}, QStringLiteral("List all available extractors."));
125 QCommandLineOption ctxOpt({QStringLiteral("c"), QStringLiteral("context-date")}, QStringLiteral("ISO date/time for when this data has been received."), QStringLiteral("date"));
127 QCommandLineOption typeOpt({QStringLiteral("t"), QStringLiteral("type")}, QStringLiteral("Deprecated, no longer needed and ignored."), QStringLiteral("type"));
129 QCommandLineOption extOpt({QStringLiteral("e"), QStringLiteral("extractors")}, QStringLiteral("Additional extractors to apply."), QStringLiteral("extractors"));
131 QCommandLineOption pathsOpt({QStringLiteral("additional-search-path")}, QStringLiteral("Additional search path for extractors."), QStringLiteral("search-path"));
133 QCommandLineOption formatOpt({QStringLiteral("o"), QStringLiteral("output")}, QStringLiteral("Output format [JsonLd, iCal]. Default: JsonLd"), QStringLiteral("format"));
135 QCommandLineOption noValidationOpt({QStringLiteral("no-validation")}, QStringLiteral("Disable result validation."));
138 parser.addPositionalArgument(QStringLiteral("input"), QStringLiteral("File to extract data from, omit for using stdin."));
166 const auto files = parser.positionalArguments().isEmpty() ? QStringList(QString()) : parser.positionalArguments();
QString toString(const Calendar::Ptr &calendar) override
void setAdditionalExtractors(std::vector< const AbstractExtractor * > &&extractors)
Sets additional extractors to run on the given data.
Definition engine/extractorengine.cpp:162
void setData(const QByteArray &data, QStringView fileName={}, QStringView mimeType={})
Set raw data to extract from.
Definition engine/extractorengine.cpp:120
void clear()
Resets the internal state, call before processing new input data.
Definition engine/extractorengine.cpp:114
void setContextDate(const QDateTime &dt)
Set the date the extracted document has been issued at.
Definition engine/extractorengine.cpp:135
QJsonArray extract()
Perform the actual extraction, and return the JSON-LD data that has been found.
Definition engine/extractorengine.cpp:150
void setUseSeparateProcess(bool separateProcess)
Perform extraction of "risky" content such as PDF files in a separate process.
Definition engine/extractorengine.cpp:157
Post-process extracted data to filter out garbage and augment data from other sources.
Definition extractorpostprocessor.h:62
void setContextDate(const QDateTime &dt)
The date the reservation(s) processed here have been made, if known.
Definition extractorpostprocessor.cpp:175
QList< QVariant > result() const
This returns the final result of all previously executed processing steps followed by sorting and fil...
Definition extractorpostprocessor.cpp:116
void process(const QList< QVariant > &data)
This will normalize and augment the given data elements and merge them with already added data elemen...
Definition extractorpostprocessor.cpp:67
Collection of all known data extractors.
Definition extractorrepository.h:34
void setAdditionalSearchPaths(const QStringList &searchPaths)
Sets additional search paths to look for extractors.
Definition extractorrepository.cpp:192
const std::vector< std::unique_ptr< AbstractExtractor > > & extractors() const
All known extractors.
Definition extractorrepository.cpp:82
const AbstractExtractor * extractorByName(QStringView name) const
Returns the extractor with the given identifier.
Definition extractorrepository.cpp:106
static QJsonArray toJson(const QList< QVariant > &data)
Serialize instantiated data types to JSON-LD.
Definition jsonlddocument.cpp:497
static QList< QVariant > fromJson(const QJsonArray &array)
Convert JSON-LD array into instantiated data types.
Definition jsonlddocument.cpp:339
static bool isSame(const QVariant &lhs, const QVariant &rhs)
Checks if two Reservation or Trip values refer to the same booking element.
Definition mergeutil.cpp:155
A single unstructured data extraction rule set.
Definition scriptextractor.h:77
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
void fillEvent(const QList< QVariant > &reservations, const QSharedPointer< KCalendarCore::Event > &event)
Fills event with details of reservations.
Definition calendarhandler.cpp:135
QString capabilitiesString()
Textual representation, mainly useful for bug reports/support.
Definition extractorcapabilities.cpp:20
bool canConvert(const QVariant &value)
Checks if the given value can be up-cast to T.
Definition datatypes.h:31
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
const char * constData() const const
char toLatin1() const const
QCommandLineOption addHelpOption()
bool addOption(const QCommandLineOption &option)
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax)
QCommandLineOption addVersionOption()
bool isSet(const QCommandLineOption &option) const const
QStringList positionalArguments() const const
void process(const QCoreApplication &app)
void setApplicationDescription(const QString &description)
QString value(const QCommandLineOption &option) const const
QStringList values(const QCommandLineOption &option) const const
QString applicationDirPath()
void setApplicationName(const QString &application)
void setApplicationVersion(const QString &version)
void setOrganizationDomain(const QString &orgDomain)
void setOrganizationName(const QString &orgName)
QDateTime currentDateTime()
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
QChar listSeparator()
QChar separator()
virtual QString fileName() const const override
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
void setFileName(const QString &name)
QString errorString() const const
QByteArray readAll()
ReadOnly
QByteArray toJson(JsonFormat format) const const
const_reference at(qsizetype i) const const
void clear()
iterator end()
bool isEmpty() const const
void push_back(parameter_type value)
void reserve(qsizetype size)
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool isEmpty() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QByteArray toUtf8() const const
CaseInsensitive
ISODate
SkipEmptyParts
QTimeZone systemTimeZone()
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.