KItinerary
iatabcbpparser.cpp
38QList<QVariant> IataBcbpParser::parse(const QString &message, const QDateTime &externalIssueDate) {
46[[nodiscard]] static QString ticketNumber(QStringView airlineNumericCode, QStringView documentNumber)
52 if (std::any_of(airlineNumericCode.begin(), airlineNumericCode.end(), [](QChar c) { return !c.isDigit(); })
53 || std::any_of(documentNumber.begin(), documentNumber.end(), [](QChar c) { return !c.isDigit(); })) {
57 if (std::all_of(documentNumber.begin(), documentNumber.end(), [](QChar c) { return c == '0'_L1; })) {
64// check if one of the airports is actually a train station, and convert the reservation accordingly
71 if (KnowledgeDb::coordinateForAirport(from).isValid() && KnowledgeDb::coordinateForAirport(to).isValid()) {
74 if (KnowledgeDb::stationForIataCode(from).coordinate.isValid() || KnowledgeDb::stationForIataCode(to).coordinate.isValid()) {
75 auto trainRes = JsonLdDocument::fromJsonSingular(ReservationConverter::flightToTrain(JsonLdDocument::toJson(res))).value<TrainReservation>();
117 flight.setDepartureDay(rms.dateOfFlight(issueDate.isValid() ? QDateTime(issueDate, {}) : contextDate));
Q_INVOKABLE KItinerary::IataBcbpRepeatedConditionalSection repeatedConditionalSection(int leg) const
Conditional (optional) section of leg.
Definition iatabcbp.cpp:92
Q_INVOKABLE KItinerary::IataBcbpRepeatedMandatorySection repeatedMandatorySection(int leg) const
Mandatory section of leg.
Definition iatabcbp.cpp:83
static QJsonArray toJson(const QList< QVariant > &data)
Serialize instantiated data types to JSON-LD.
Definition jsonlddocument.cpp:497
static QVariant fromJsonSingular(const QJsonObject &obj)
Convert a single JSON-LD object into an instantiated data type.
Definition jsonlddocument.cpp:361
A frequent traveler, bonus points or discount scheme program membership.
Definition programmembership.h:22
QString fullName(const PartType &type)
QList< QVariant > parse(const QString &message, const QDateTime &externalIssueDateTime=QDateTime())
Parses the bar coded boarding pass message message into a list of FlightReservation instances.
Definition iatabcbpparser.cpp:38
Coordinate coordinateForAirport(IataCode iataCode)
Returns the geographical coordinates the airport with IATA code iataCode is in.
Definition airportdb.cpp:30
TrainStation stationForIataCode(IataCode iataCode)
Lookup train station data by IATA location code.
Definition trainstationdb.cpp:76
QJsonObject flightToTrain(const QJsonObject &flightRes)
Convert a flight reservation to a train reservation.
Definition reservationconverter.cpp:86
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
bool isValid(QStringView ifopt)
bool isValid() const const
void push_back(parameter_type value)
void reserve(qsizetype size)
iterator begin()
iterator end()
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
qsizetype size() const const
const_iterator begin() const const
const_iterator end() const const
qsizetype size() const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.