KItinerary
uic9183documentprocessor.cpp
42bool Uic9183DocumentProcessor::canHandleData(const QByteArray &encodedData, [[maybe_unused]] QStringView fileName) const
47ExtractorDocumentNode Uic9183DocumentProcessor::createNodeFromData(const QByteArray &encodedData) const
60void Uic9183DocumentProcessor::expandNode(ExtractorDocumentNode &node, [[maybe_unused]] const ExtractorEngine *engine) const
63 // while that is usually correct it cannot contain a time zone, unlike the (often) enclosing PDF document´
67 node.setContextDateTime(std::visit([](auto &&fcb) { return fcb.issuingDetail.issueingDateTime(); }, u_flex.fcb()));
100void Uic9183DocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_unused]] const ExtractorEngine *engine) const
208 res.setPriceCurrency(QString::fromUtf8(std::visit([](auto &&fcb) { return fcb.issuingDetail.currency; }, flex.fcb())));
226 trip.setTrainNumber(irt.serviceBrandAbrUTF8 + QLatin1Char(' ') + QString::number(irt.trainNum));
228 trip.setTrainNumber(irt.serviceBrandAbrUTF8 + QLatin1Char(' ') + QString::fromUtf8(irt.trainIA5));
249 res.setTotalPrice(irt.price / std::pow(10, std::visit([](auto &&fcb) { return fcb.issuingDetail.currencyFract; }, flex.fcb())));
A node in the extracted document object tree.
Definition extractordocumentnode.h:50
void setContextDateTime(const QDateTime &contextDateTime)
Set the context date/time.
Definition extractordocumentnode.cpp:173
void addResult(ExtractorResult &&result)
Add additional results from an extraction step.
Definition extractordocumentnode.cpp:155
QDateTime contextDateTime
The best known context date/time at this point in the document tree.
Definition extractordocumentnode.h:68
void setContent(const QVariant &content)
Set decoded content.
Definition extractordocumentnode.cpp:120
bool isValidElement(const QVariant &elem) const
Checks if the given element is valid.
Definition extractorvalidator.cpp:230
void setAcceptedTypes(std::vector< const QMetaObject * > &&accptedTypes)
Sets the list of supported top-level types that should be accepted.
Definition extractorvalidator.cpp:59
static QString classCodeToString(Fcb::v13::TravelClassType classCode)
Convert a class code enum value to a string for human representation.
Definition fcbutil.cpp:30
A frequent traveler, bonus points or discount scheme program membership.
Definition programmembership.h:22
QDateTime validFrom
Non-standard extension for ticket validity time ranges.
Definition programmembership.h:44
@ Unknown
ticket type could not be detected, or ticket type not supported yet
Definition rct2ticket.h:75
void expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override
Create child nodes for node, as far as that's necessary for this document type.
Definition uic9183documentprocessor.cpp:60
ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override
Create a document node from raw data.
Definition uic9183documentprocessor.cpp:47
void preExtract(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override
Called before extractors are applied to node.
Definition uic9183documentprocessor.cpp:100
bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override
Fast check whether the given encoded data can possibly be processed by this instance.
Definition uic9183documentprocessor.cpp:42
Represents a U_FLEX block holding different versions of an FCB payload.
Definition uic9183flex.h:24
bool isValid() const
Returns whether this is a valid U_FLEX layout block.
Definition uic9183flex.cpp:49
static void readArrivalStation(const QVariant &doc, TrainStation &station)
Read arrival station info from the given FCB travel document, if applicable.
Definition uic9183flex.cpp:93
static void fixStationCode(TrainStation &station)
Fix known issues with station identifiers.
Definition uic9183flex.cpp:102
static void readDepartureStation(const QVariant &doc, TrainStation &station)
Read departure station info from the given FCB travel document, if applicable.
Definition uic9183flex.cpp:84
Parser for UIC 918.3 and 918.3* train tickets.
Definition uic9183parser.h:38
static bool maybeUic9183(const QByteArray &data)
Quickly checks if might be UIC 918.3 content.
Definition uic9183parser.cpp:668
QString i18n(const char *text, const TYPE &arg...)
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
bool isValid() const const
void push_back(parameter_type value)
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
QString number(double n, char format, int precision)
QString join(QChar separator) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:36 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:36 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.