Commit 921dbf01 authored by Volker Krause's avatar Volker Krause
Browse files

Make UIC 913.8 header and the U_HEAD block structure externally usable

Needed by KItinerary Workbench, but also useful for use from extractor
scripts.
parent 200177b8
Pipeline #76819 passed with stage
in 13 minutes and 42 seconds
......@@ -259,6 +259,7 @@ ecm_generate_headers(KItinerary_Pdf_FORWARDING_HEADERS
ecm_generate_headers(KItinerary_Uic9183_FORWARDING_HEADERS
HEADER_NAMES
Rct2Ticket
Uic9183Header
Uic9183Block
Uic9183Parser
Uic9183TicketLayout
......
......@@ -8,6 +8,8 @@
using namespace KItinerary;
Uic9183Head::Uic9183Head() = default;
// U_HEAD Block (version 1, size 53)
// 4x issuing carrier id
// 6x PNR
......@@ -24,6 +26,8 @@ Uic9183Head::Uic9183Head(const Uic9183Block &block)
}
}
Uic9183Head::~Uic9183Head() = default;
bool Uic9183Head::isValid() const
{
return !m_data.isNull();
......
......@@ -29,7 +29,9 @@ class KITINERARY_EXPORT Uic9183Head
UIC_STR_PROPERTY(secondaryLanguage, 39, 2);
public:
Uic9183Head();
Uic9183Head(const Uic9183Block &block);
~Uic9183Head();
/** Returns @c true if this is a valid U_HEAD block. */
bool isValid() const;
......@@ -43,3 +45,4 @@ private:
}
Q_DECLARE_METATYPE(KItinerary::Uic9183Head)
......@@ -63,6 +63,9 @@ QVariant Uic9183Parser::block(const QString &name) const
return {};
}
if (name == QLatin1String(Uic9183Head::RecordId)) {
return QVariant::fromValue(findBlock<Uic9183Head>());
}
if (name == QLatin1String("0080BL")) {
return QVariant::fromValue(findBlock<Vendor0080BLBlock>());
}
......
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