KItinerary

vendor1154block.h
1/*
2 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KITINERARY_VENDOR1154BLOCK_H
7#define KITINERARY_VENDOR1154BLOCK_H
8
9#include "kitinerary_export.h"
10#include "uic9183block.h"
11
12namespace KItinerary {
13
14/** UIC 918.3 1154UT vendor data block sub-block. */
15class KITINERARY_EXPORT Vendor1154UTSubBlock
16{
17 Q_GADGET
18 Q_PROPERTY(QString content READ toString)
19public:
21 Vendor1154UTSubBlock(const Uic9183Block &block, int offset);
22 bool isNull() const;
23
24 /** Type of the block. */
25 const char *id() const;
26 /** Size of the entire S-block. */
27 int size() const;
28 /** Next sub-block in the 1154UT block. */
29 Vendor1154UTSubBlock nextBlock() const;
30
31 /** Size of the content the sub-block. */
32 int contentSize() const;
33 /** Content data of the sub-block. */
34 const char *content() const;
35
36 /** Content as Unicode string. */
37 QString toString() const;
38
39private:
40 Uic9183Block m_block;
41 int m_offset = 0;
42};
43
44/** UIC 918.3 1154UT vendor data block. */
45class KITINERARY_EXPORT Vendor1154UTBlock
46{
47 Q_GADGET
48public:
50
51 bool isValid() const;
52 /** First S-block, for iterating. */
53 Vendor1154UTSubBlock firstBlock() const;
54 /** Finds a S-block by type. */
55 Vendor1154UTSubBlock findSubBlock(const char id[2]) const;
56 Q_INVOKABLE QVariant findSubBlock(const QString &str) const;
57
58 static constexpr const char RecordId[] = "1154UT";
59private:
60 Uic9183Block m_block;
61};
62
63}
64
65#endif // KITINERARY_VENDOR1154BLOCK_H
A data block from a UIC 918.3 ticket.
UIC 918.3 1154UT vendor data block.
Vendor1154UTSubBlock findSubBlock(const char id[2]) const
Finds a S-block by type.
UIC 918.3 1154UT vendor data block sub-block.
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 Mon Nov 18 2024 12:09:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.