KItinerary

vdvticketparser.h
1/*
2 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kitinerary_export.h"
10#include "vdvticket.h"
11
12class QByteArray;
13
14namespace KItinerary {
15
16/** Parser for VDV tickets.
17 * Or more correctly for: "Statische Berechtigungen der VDV-Kernapplikation"
18 * That is, a standard for 2D barcode tickets for local public transport, commonly found in Germany
19 * and some neighbouring countries.
20 *
21 * This is based on "VDV-Kernapplikation - Spezifikation statischer Berechtigungen für 2D Barcode-Tickets"
22 * which your favorite search engine should find as a PDF.
23 *
24 * The crypto stuff used here is ISO 9796-2, and you'll find some terminology also used in ISO 7816-6/8,
25 * which isn't entirely surprising given this also exists in a NFC card variant.
26 *
27 * Do not use directly, only installed for use in tooling.
28 *
29 * @see https://de.wikipedia.org/wiki/VDV-Kernapplikation
30 */
31class KITINERARY_EXPORT VdvTicketParser
32{
33public:
36
37 /** Tries to parse the ticket in @p data. */
38 bool parse(const QByteArray &data);
39
40 /** Returns the parsed ticket data. */
41 VdvTicket ticket() const;
42
43 /** Fast check if @p data might contain a VDV ticket.
44 * Does not perform full decoding, mainly useful for content auto-detection.
45 */
46 static bool maybeVdvTicket(const QByteArray &data);
47
48private:
49 VdvTicket m_ticket;
50};
51
52}
53
Parser for VDV tickets.
Ticket information from a VDV barcode.
Definition vdvticket.h:30
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:49 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.