KItinerary
9#include "kitinerary_export.h"
12#include "knowledgedb.h"
20class UICIdentiferBase :
public UnalignedNumber<3> {
22 inline explicit constexpr UICIdentiferBase() =
default;
23 inline explicit constexpr UICIdentiferBase(uint32_t
id) :
24 UnalignedNumber<3>(
id > 9999999 ?
id / 10 :
id)
27 KITINERARY_EXPORT UICIdentiferBase(
const QString &
id);
29 inline constexpr bool isValid()
const
31 return value() >= 1000000 && value() <= 9999999;
39class IBNR :
public UICIdentiferBase {
40 using UICIdentiferBase::UICIdentiferBase;
48 using UICIdentiferBase::UICIdentiferBase;
53class FiveAlphaId :
public UnalignedNumber<3> {
55 inline explicit constexpr FiveAlphaId() =
default;
56 inline explicit constexpr FiveAlphaId(
const char s[5])
57 : UnalignedNumber<3>(fromChars(s))
61 KITINERARY_EXPORT
explicit FiveAlphaId(
const QString &
id);
63 inline constexpr bool isValid()
const
68 KITINERARY_EXPORT
QString toString()
const;
71 static inline constexpr uint32_t fromChars(
const char s[5])
73 return (s[4] -
'@') + 27 * ((s[3] -
'@') + 27 * ((s[2] -
'@') + 27 * ((s[1] -
'@') + 27 * (s[0] -
'@'))));
82 using FiveAlphaId::FiveAlphaId;
90 using FiveAlphaId::FiveAlphaId;
97class VRStationCode :
public UnalignedNumber<3>
100 inline constexpr VRStationCode() =
default;
101 inline explicit constexpr VRStationCode(
const char s[4])
102 : UnalignedNumber<3>(fromChars(s))
104 KITINERARY_EXPORT
explicit VRStationCode(
const QString &
id);
106 [[nodiscard]]
inline constexpr bool isValid()
const
111 [[nodiscard]] KITINERARY_EXPORT
QString toString()
const;
114 [[nodiscard]]
static inline constexpr uint32_t charVal(uint8_t c)
118 case 0xC4:
return 27;
119 case 0xD6:
return 28;
123 [[nodiscard]]
static inline constexpr uint32_t fromChars(
const char s[4])
125 return (charVal(s[0]) << 18) + (charVal(s[1]) << 12) + (charVal(s[2]) << 6) + charVal(s[3]);
Compact storage for fixed-size identifiers consisting out of uppercase latin letters,...
Lookup functions, utilities and data types for the static knowledge database.
AlphaId< UnalignedNumber< 3 >, 4 > ViaRailStationCode
Via Rail station code.
AlphaId< uint16_t, 3 > UKRailwayStationCode
UK railway station code.
AlphaId< uint16_t, 3 > AmtrakStationCode
Amtrak staion codes.
Classes for reservation/travel data models, data extraction and data augmentation.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:35 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.