Commit 33d964b0 authored by Volker Krause's avatar Volker Krause
Browse files

Add raw data access for ERA SSB ticket objects

Needed to generate correct barcodes out of this again.
parent 8736d57e
......@@ -96,3 +96,8 @@ QDate SSBTicket::type1DepartureDay(const QDate& contextDate)
const auto d = issueDate(contextDate);
return d.addDays(type1DepartureDate());
}
QByteArray SSBTicket::rawData() const
{
return m_data;
}
......@@ -109,6 +109,8 @@ class KITINERARY_EXPORT SSBTicket {
};
Q_ENUM(TicketType)
Q_PROPERTY(QByteArray rawData READ rawData)
public:
SSBTicket();
explicit SSBTicket(const QByteArray &data);
......@@ -122,6 +124,9 @@ public:
/** Departure day for type 1 (IRT/RES/BOA) tickets. */
Q_INVOKABLE QDate type1DepartureDay(const QDate &contextDate = QDate::currentDate());
/** Raw barcode data. */
QByteArray rawData() const;
/** Returns @c true if @p data might be an ERA SSB ticket. */
static bool maybeSSB(const QByteArray &data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment