KItinerary

fcbticket.cpp
1/*
2 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#include "fcbticket.h"
7
8#include "logging.h"
9#include "asn1/uperdecoder.h"
10
11#define FCB_READ_CONSTRAINED_INT(Name, Min, Max) \
12 if (Name ## IsSet()) \
13 Name = decoder.readConstrainedWholeNumber(Min, Max)
14
15#define FCB_READ_UNCONSTRAINED_INT(Name) \
16 if (Name ## IsSet()) \
17 Name = decoder.readUnconstrainedWholeNumber()
18
19#define FCB_READ_IA5STRING(Name) \
20 if (Name ## IsSet()) \
21 Name = decoder.readIA5String()
22
23#define FCB_READ_IA5STRING_CONSTRAINED(Name, Min, Max) \
24 if (Name ## IsSet()) \
25 Name = decoder.readIA5String(Min, Max)
26
27#define FCB_READ_UTF8STRING(Name) \
28 if (Name ## IsSet()) \
29 Name = decoder.readUtf8String()
30
31#define FCB_READ_OCTETSTRING(Name) \
32 if (Name ## IsSet()) \
33 Name = decoder.readOctetString()
34
35#define FCB_READ_ENUM(Name) \
36 do { if (Name ## IsSet()) { \
37 if constexpr (uperHasExtensionMarker(decltype(Name){})) { \
38 Name = decoder.readEnumeratedWithExtensionMarker<decltype(Name)>(); \
39 } else { \
40 Name = decoder.readEnumerated<decltype(Name)>(); \
41 } \
42 } } while(false)
43
44#define FCB_READ_CUSTOM(Name) \
45 if (Name ## IsSet()) \
46 Name.decode(decoder);
47
48#define FCB_READ_SEQUENCE_OF_CONTRAINED_INT(Name, Min, Max) \
49 if (Name ## IsSet()) \
50 Name = decoder.readSequenceOfConstrainedWholeNumber(Min, Max)
51
52#define FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(Name) \
53 if (Name ## IsSet()) \
54 Name = decoder.readSequenceOfUnconstrainedWholeNumber()
55
56#define FCB_READ_SEQUENCE_OF_IA5STRING(Name) \
57 if (Name ## IsSet()) \
58 Name = decoder.readSequenceOfIA5String()
59
60#define FCB_READ_SEQUENCE_OF_UTF8STRING(Name) \
61 if (Name ## IsSet()) \
62 Name = decoder.readSequenceOfUtf8String()
63
64#define FCB_READ_SEQUENCE_OF_CUSTOM(Name) \
65 if (Name ## IsSet()) \
66 Name = decoder.readSequenceOf<decltype(Name)::value_type>();
67
68#define FCB_READ_INT_IA5_PAIR(Name, Min, Max) \
69 FCB_READ_CONSTRAINED_INT(Name ## Num, Min, Max); \
70 FCB_READ_IA5STRING(Name ## IA5)
71
72#define FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(Name) \
73 FCB_READ_UNCONSTRAINED_INT(Name ## Num); \
74 FCB_READ_IA5STRING(Name ## IA5)
75
76using namespace KItinerary;
77
78void Fcb::ExtensionData::decode(KItinerary::UPERDecoder &decoder)
79{
80 decodeSequence(decoder);
81 extensionId = decoder.readIA5String();
82 extensionData = decoder.readOctetString();
83}
84
85void Fcb::GeoCoordinateType::decode(UPERDecoder &decoder)
86{
87 decodeSequence(decoder);
88 FCB_READ_ENUM(geoUnit);
89 FCB_READ_ENUM(coordinateSystem);
90 FCB_READ_ENUM(hemisphereLongitude);
91 FCB_READ_ENUM(hemisphereLongitude);
92 longitude = decoder.readUnconstrainedWholeNumber();
93 latitude = decoder.readUnconstrainedWholeNumber();
94 FCB_READ_ENUM(accuracy);
95}
96
97void Fcb::DeltaCoordinate::decode(UPERDecoder &decoder)
98{
99 decodeSequence(decoder);
100 longitude = decoder.readUnconstrainedWholeNumber();
101 latitude = decoder.readUnconstrainedWholeNumber();
102}
103
104void Fcb::IssuingData::decode(UPERDecoder &decoder)
105{
106 decodeSequence(decoder);
107 FCB_READ_INT_IA5_PAIR(securityProvider, 1, 32000);
108 FCB_READ_INT_IA5_PAIR(issuer, 1, 32000);
109 issuingYear = decoder.readConstrainedWholeNumber(2016, 2269);
110 issuingDay = decoder.readConstrainedWholeNumber(1, 366);
111 FCB_READ_CONSTRAINED_INT(issuingTime, 0, 1440);
112 FCB_READ_UTF8STRING(issuerName);
113 specimen = decoder.readBoolean();
114 securePaperTicket = decoder.readBoolean();
115 activated = decoder.readBoolean();
116 FCB_READ_IA5STRING_CONSTRAINED(currency, 3, 3);
117 FCB_READ_CONSTRAINED_INT(currencyFract, 1, 3);
118 FCB_READ_IA5STRING(issuerPNR);
119 FCB_READ_CUSTOM(extension);
120 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(issuedOnTrain);
121 FCB_READ_UNCONSTRAINED_INT(issuedOnLine);
122 FCB_READ_CUSTOM(pointOfSale);
123}
124
125QDateTime Fcb::IssuingData::issueingDateTime() const
126{
127 QDate date(issuingYear, 1, 1);
128 date = date.addDays(issuingDay - 1);
129 if (issuingTimeIsSet()) {
130 return QDateTime(date, QTime(0,0).addSecs(issuingTime * 60), QTimeZone::UTC);
131 }
132 return QDateTime(date, {});
133}
134
135void Fcb::CustomerStatusType::decode(UPERDecoder &decoder)
136{
137 decodeSequence(decoder);
138 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(statusProvider);
139 FCB_READ_UNCONSTRAINED_INT(customerStatus);
140 FCB_READ_IA5STRING(customerStatusDescr);
141}
142
143void Fcb::TravelerType::decode(UPERDecoder &decoder)
144{
145 decodeSequence(decoder);
146 FCB_READ_UTF8STRING(firstName);
147 FCB_READ_UTF8STRING(secondName);
148 FCB_READ_UTF8STRING(lastName);
149 FCB_READ_IA5STRING(idCard);
150 FCB_READ_IA5STRING(passportId);
151 FCB_READ_IA5STRING(title);
152 FCB_READ_ENUM(gender);
153 FCB_READ_IA5STRING(customerIdIA5);
154 FCB_READ_UNCONSTRAINED_INT(customerIdNum);
155 FCB_READ_CONSTRAINED_INT(yearOfBirth, 1901, 2155);
156 FCB_READ_CONSTRAINED_INT(dayOfBirth, 0, 370);
157 ticketHolder = decoder.readBoolean();
158 FCB_READ_ENUM(passengerType);
159 if (passengerWithReducedMobilityIsSet()) {
160 passengerWithReducedMobility = decoder.readBoolean();
161 }
162 FCB_READ_CONSTRAINED_INT(countryOfResidence, 1, 999);
163 FCB_READ_CONSTRAINED_INT(countryOfPassport, 1, 999);
164 FCB_READ_CONSTRAINED_INT(countryOfIdCard, 1, 999);
165 FCB_READ_SEQUENCE_OF_CUSTOM(status);
166}
167
168void Fcb::TravelerData::decode(UPERDecoder &decoder)
169{
170 decodeSequence(decoder);
171 FCB_READ_SEQUENCE_OF_CUSTOM(traveler);
172 FCB_READ_IA5STRING_CONSTRAINED(preferredLanguage, 2, 2);
173 FCB_READ_UTF8STRING(groupName);
174}
175
176void Fcb::TrainLinkType::decode(UPERDecoder &decoder)
177{
178 decodeSequence(decoder);
179 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
180 travelDate = decoder.readConstrainedWholeNumber(-1, 370);
181 departureTime = decoder.readConstrainedWholeNumber(0, 1440);
182 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
183 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
184 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
185 FCB_READ_UTF8STRING(fromStationNameUTF8);
186 FCB_READ_UTF8STRING(toStationNameUTF8);
187}
188
189QDateTime Fcb::TrainLinkType::departureDateTime(const QDateTime &issueingDateTime) const
190{
191 QDate date = issueingDateTime.date().addDays(travelDate);
192 QTime time = QTime(0, 0).addSecs(departureTime * 60);
193 if (departureUTCOffsetIsSet()) {
194 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-departureUTCOffset * 15 * 60));
195 }
196 return QDateTime(date, time);
197}
198
199void Fcb::ViaStationType::decode(UPERDecoder &decoder)
200{
201 decodeSequence(decoder);
202 FCB_READ_ENUM(stationCodeTable);
203 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
204 FCB_READ_SEQUENCE_OF_CUSTOM(alternativeRoutes);
205 FCB_READ_SEQUENCE_OF_CUSTOM(route);
206 border = decoder.readBoolean();
207 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
208 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
209 FCB_READ_UNCONSTRAINED_INT(seriesId);
210 FCB_READ_UNCONSTRAINED_INT(routeId);
211}
212
213void Fcb::ZoneType::decode(UPERDecoder &decoder)
214{
215 decodeSequence(decoder);
216 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
217 FCB_READ_ENUM(stationCodeTable);
218 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
219 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
220 FCB_READ_UNCONSTRAINED_INT(city);
221 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(zoneId);
222 FCB_READ_OCTETSTRING(binaryZoneId);
223 FCB_READ_IA5STRING(nutsCode);
224}
225
226void Fcb::LineType::decode(UPERDecoder &decoder)
227{
228 decodeSequence(decoder);
229 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
230 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(lineId);
231 FCB_READ_ENUM(stationCodeTable);
232 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
233 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
234 FCB_READ_CONSTRAINED_INT(city, 1, 9999999);
235 FCB_READ_OCTETSTRING(binaryZoneId);
236}
237
238void Fcb::PolygoneType::decode(UPERDecoder &decoder)
239{
240 decodeSequence(decoder);
241 firstEdge.decode(decoder);
242 edges = decoder.readSequenceOf<DeltaCoordinate>();
243}
244
245void Fcb::RegionalValidityType::decode(UPERDecoder &decoder)
246{
247 value = decoder.readChoiceWithExtensionMarker<TrainLinkType, ViaStationType, ZoneType, LineType, PolygoneType>();
248}
249
250void Fcb::ReturnRouteDescriptionType::decode(UPERDecoder &decoder)
251{
252 decodeSequence(decoder);
253 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
254 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
255 FCB_READ_UTF8STRING(fromStationNameUTF8);
256 FCB_READ_UTF8STRING(toStationNameUTF8);
257 FCB_READ_UTF8STRING(validReturnRegionDesc);
258 FCB_READ_SEQUENCE_OF_CUSTOM(validReturnRegion);
259}
260
261void Fcb::RouteSectionType::decode(UPERDecoder &decoder)
262{
263 decodeSequence(decoder);
264 FCB_READ_ENUM(stationCodeTable);
265 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
266 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
267 FCB_READ_UTF8STRING(fromStationNameUTF8);
268 FCB_READ_UTF8STRING(toStationNameUTF8);
269}
270
271void Fcb::SeriesDetailType::decode(UPERDecoder &decoder)
272{
273 decodeSequence(decoder);
274 FCB_READ_CONSTRAINED_INT(supplyingCarrier, 1, 32000);
275 FCB_READ_CONSTRAINED_INT(offerIdentification, 1, 99);
276 FCB_READ_UNCONSTRAINED_INT(series);
277}
278
279void Fcb::CardReferenceType::decode(UPERDecoder &decoder)
280{
281 decodeSequence(decoder);
282 FCB_READ_INT_IA5_PAIR(cardIssuer, 1, 32000);
283 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(cardId);
284 FCB_READ_UTF8STRING(cardName);
285 FCB_READ_UNCONSTRAINED_INT(cardType);
286 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(leadingCardId);
287 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(trailingCardId);
288}
289
290void Fcb::PlacesType::decode(KItinerary::UPERDecoder &decoder)
291{
292 decodeSequence(decoder);
293 FCB_READ_IA5STRING(coach);
294 FCB_READ_IA5STRING(placeString);
295 FCB_READ_UTF8STRING(placeDescription);
296 FCB_READ_SEQUENCE_OF_IA5STRING(placeIA5);
297 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(placeNum, 1, 254);
298}
299
300void Fcb::CompartmentDetailsType::decode(UPERDecoder &decoder)
301{
302 decodeSequence(decoder);
303 FCB_READ_CONSTRAINED_INT(coachType, 1, 99);
304 FCB_READ_CONSTRAINED_INT(compartmentType, 1, 99);
305 FCB_READ_CONSTRAINED_INT(specialAllocation, 1, 99);
306 FCB_READ_UTF8STRING(coachTypeDescr);
307 FCB_READ_UTF8STRING(compartmentTypeDescr);
308 FCB_READ_UTF8STRING(specialAllocationDescr);
309 FCB_READ_ENUM(position);
310}
311
312void Fcb::BerthDetailData::decode(UPERDecoder &decoder)
313{
314 decodeSequence(decoder);
315 berthType = decoder.readEnumerated<BerthTypeType>();
316 numberOfBerths = decoder.readConstrainedWholeNumber(1, 999);
317 FCB_READ_ENUM(gender);
318}
319
320void Fcb::TariffType::decode(UPERDecoder &decoder)
321{
322 decodeSequence(decoder);
323 FCB_READ_CONSTRAINED_INT(numberOfPassengers, 1, 200);
324 FCB_READ_ENUM(passengerType);
325 FCB_READ_CONSTRAINED_INT(ageBelow, 1, 64);
326 FCB_READ_CONSTRAINED_INT(ageAbove, 1, 128);
327 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(travelerid, 0, 254);
328 restrictedToCountryOfResidence = decoder.readBoolean();
329 FCB_READ_CUSTOM(restrictedToRouteSection);
330 FCB_READ_CUSTOM(seriesDataDetails);
331 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tariffId);
332 FCB_READ_UTF8STRING(tariffDesc);
333 FCB_READ_SEQUENCE_OF_CUSTOM(reductionCard);
334}
335
336void Fcb::VatDetailType::decode(UPERDecoder &decoder)
337{
338 decodeSequence(decoder);
339 country = decoder.readConstrainedWholeNumber(1, 999);
340 percentage = decoder.readConstrainedWholeNumber(0, 999);
341 FCB_READ_UNCONSTRAINED_INT(amount);
342 FCB_READ_IA5STRING(vatId);
343}
344
345void Fcb::IncludedOpenTicketType::decode(UPERDecoder &decoder)
346{
347 decodeSequence(decoder);
348 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
349 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
350 FCB_READ_UNCONSTRAINED_INT(externalIssuerId);
351 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
352 FCB_READ_ENUM(stationCodeTable);
353 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
354 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
355 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
356 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
357 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
358 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1440);
359 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
360 FCB_READ_ENUM(classCode);
361 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
362 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
363 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
364 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
365 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
366 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
367 FCB_READ_UTF8STRING(infoText);
368 FCB_READ_CUSTOM(extension);
369}
370
371void Fcb::RegisteredLuggageType::decode(UPERDecoder &decoder)
372{
373 decodeSequence(decoder);
374 FCB_READ_IA5STRING(registrationId);
375 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
376 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
377}
378
379void Fcb::LuggageRestrictionType::decode(UPERDecoder &decoder)
380{
381 decodeSequence(decoder);
382 FCB_READ_CONSTRAINED_INT(maxHandLuggagePieces, 0, 99);
383 FCB_READ_CONSTRAINED_INT(maxNonHandLuggagePieces, 0, 99);
384 FCB_READ_SEQUENCE_OF_CUSTOM(registeredLuggage);
385}
386
387void Fcb::ReservationData::decode(UPERDecoder &decoder)
388{
389 decodeSequence(decoder);
390 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
391 FCB_READ_CONSTRAINED_INT(departureDate, -1, 370);
392 FCB_READ_IA5STRING(referenceIA5);
393 FCB_READ_UNCONSTRAINED_INT(referenceNum);
394 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
395 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
396 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
397 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
398 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
399 FCB_READ_ENUM(service);
400 FCB_READ_ENUM(stationCodeTable);
401 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
402 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
403 FCB_READ_UTF8STRING(fromStationNameUTF8);
404 FCB_READ_UTF8STRING(toStationNameUTF8);
405 departureTime = decoder.readConstrainedWholeNumber(0, 1440);
406 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
407 FCB_READ_CONSTRAINED_INT(arrivalDate, 0, 20);
408 FCB_READ_CONSTRAINED_INT(arrivalTime, 0, 1440);
409 FCB_READ_CONSTRAINED_INT(arrivalUTCOffset, -60, 60);
410 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
411 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
412 FCB_READ_ENUM(classCode);
413 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
414 FCB_READ_CUSTOM(places);
415 FCB_READ_CUSTOM(additionalPlaces);
416 FCB_READ_CUSTOM(bicyclePlaces);
417 FCB_READ_CUSTOM(compartmentDetails);
418 FCB_READ_CONSTRAINED_INT(numberOfOverbooked, 0, 200);
419 FCB_READ_SEQUENCE_OF_CUSTOM(berth);
420 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
421 FCB_READ_ENUM(priceType);
422 FCB_READ_UNCONSTRAINED_INT(price);
423 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
424 FCB_READ_CONSTRAINED_INT(typeOfSupplement, 0, 9);
425 FCB_READ_CONSTRAINED_INT(numberOfSupplements, 0, 200);
426 FCB_READ_CUSTOM(luggage);
427 FCB_READ_UTF8STRING(infoText);
428 FCB_READ_CUSTOM(extension);
429}
430
431QDateTime Fcb::ReservationData::departureDateTime(const QDateTime &issueingDateTime) const
432{
433 QDate date = issueingDateTime.date().addDays(departureDate);
434 QTime time = QTime(0, 0).addSecs(departureTime * 60);
435 if (departureUTCOffsetIsSet()) {
436 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-departureUTCOffset * 15 * 60));
437 }
438 return QDateTime(date, time);
439}
440
441QDateTime Fcb::ReservationData::arrivalDateTime(const QDateTime &issueingDateTime) const
442{
443 if (!arrivalTimeIsSet()) {
444 return {};
445 }
446 const auto departureDt = departureDateTime(issueingDateTime);
447 QDate date = departureDt.date().addDays(arrivalDate);
448 QTime time = QTime(0, 0).addSecs(arrivalTime * 60);
449 if (arrivalUTCOffsetIsSet()) {
450 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-arrivalUTCOffset * 15 * 60));
451 }
452 if (departureDt.timeSpec() == Qt::OffsetFromUTC) {
453 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(departureDt.offsetFromUtc()));
454 }
455 return QDateTime(date, time);
456}
457
458void Fcb::CarCarriageReservationData::decode(UPERDecoder &decoder)
459{
460 decodeSequence(decoder);
461 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
462 FCB_READ_CONSTRAINED_INT(beginLoadingDate, -1, 370);
463 FCB_READ_CONSTRAINED_INT(beginLoadingTime, 0, 1440);
464 FCB_READ_CONSTRAINED_INT(endLoadingTime, 0, 1440);
465 FCB_READ_CONSTRAINED_INT(loadingUTCOffset, -60, 60);
466 FCB_READ_IA5STRING(referenceIA5);
467 FCB_READ_UNCONSTRAINED_INT(referenceNum);
468 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
469 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
470 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
471 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
472 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
473 FCB_READ_ENUM(stationCodeTable);
474 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
475 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
476 FCB_READ_UTF8STRING(fromStationNameUTF8);
477 FCB_READ_UTF8STRING(toStationNameUTF8);
478 FCB_READ_IA5STRING(coach);
479 FCB_READ_IA5STRING(place);
480 FCB_READ_CUSTOM(compartmentDetails);
481 FCB_READ_IA5STRING(numberPlate);
482 FCB_READ_IA5STRING(trailerPlate);
483 carCategory = decoder.readConstrainedWholeNumber(0, 9);
484 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
485 textileRoof = decoder.readBoolean();
486 FCB_READ_ENUM(roofRackType);
487 FCB_READ_CONSTRAINED_INT(roofRackHeight, 0, 99);
488 FCB_READ_CONSTRAINED_INT(attachedBoats, 0, 2);
489 FCB_READ_CONSTRAINED_INT(attachedBicycles, 0, 4);
490 FCB_READ_CONSTRAINED_INT(attachedSurfboards, 0, 5);
491 FCB_READ_CONSTRAINED_INT(loadingListEntry, 0, 999);
492 FCB_READ_ENUM(loadingDeck);
493 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
494 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
495 tariff.decode(decoder);
496 FCB_READ_ENUM(priceType);
497 FCB_READ_UNCONSTRAINED_INT(price);
498 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
499 FCB_READ_UTF8STRING(infoText);
500 FCB_READ_CUSTOM(extension);
501}
502
503void Fcb::OpenTicketData::decode(UPERDecoder &decoder)
504{
505 decodeSequence(decoder);
506 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
507 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
508 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
509 FCB_READ_UNCONSTRAINED_INT(extIssuerId);
510 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
511 returnIncluded = decoder.readBoolean();
512 FCB_READ_ENUM(stationCodeTable);
513 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
514 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
515 FCB_READ_UTF8STRING(fromStationNameUTF8);
516 FCB_READ_UTF8STRING(toStationNameUTF8);
517 FCB_READ_UTF8STRING(validRegionDesc);
518 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
519 FCB_READ_CUSTOM(returnDescription);
520 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
521 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
522 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
523 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
524 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1440);
525 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
526 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, 370);
527 FCB_READ_ENUM(classCode);
528 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
529 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
530 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
531 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
532 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
533 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
534 FCB_READ_UNCONSTRAINED_INT(price);
535 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
536 FCB_READ_UTF8STRING(infoText);
537 FCB_READ_SEQUENCE_OF_CUSTOM(includedAddOns);
538 FCB_READ_CUSTOM(luggage);
539 FCB_READ_CUSTOM(extension);
540}
541
542QDateTime Fcb::OpenTicketData::validFrom(const QDateTime &issueingDateTime) const
543{
544 QDate date = issueingDateTime.date().addDays(validFromDay);
545 QTime time = validFromTimeIsSet() ? QTime(0, 0).addSecs(validFromTime * 60) : QTime();
546 if (validFromUTCOffsetIsSet()) {
547 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-validFromUTCOffset * 15 * 60));
548 }
549 return QDateTime(date, time);
550}
551
552QDateTime Fcb::OpenTicketData::validUntil(const QDateTime &issueingDateTime) const
553{
554 const auto validFromDt = validFrom(issueingDateTime);
555 QDate date = validFromDt.date().addDays(validUntilDay);
556 QTime time = validUntilDayIsSet() ? QTime(0, 0).addSecs(validUntilTime * 60) : QTime(23, 59, 59);
557 if (validUntilUTCOffsetIsSet()) {
558 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-validUntilUTCOffset * 15 * 60));
559 }
560 if (validFromDt.timeSpec() == Qt::OffsetFromUTC) {
561 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(validFromDt.offsetFromUtc()));
562 }
563 return QDateTime(date, time);
564}
565
566void Fcb::TimeRangeType::decode(UPERDecoder &decoder)
567{
568 decodeSequence(decoder);
569 fromTime = decoder.readConstrainedWholeNumber(0, 1440);
570 untilTime = decoder.readConstrainedWholeNumber(0, 1440);
571}
572
573void Fcb::ValidityPeriodType::decode(UPERDecoder &decoder)
574{
575 decodeSequence(decoder);
576 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
577 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
578 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
579 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
580 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1440);
581 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
582}
583
584void Fcb::ValidityPeriodDetailType::decode(UPERDecoder &decoder)
585{
586 decodeSequence(decoder);
587 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
588 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
589}
590
591void Fcb::PassData::decode(UPERDecoder &decoder)
592{
593 decodeSequence(decoder);
594 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
595 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
596 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
597 FCB_READ_CONSTRAINED_INT(passType, 1, 250);
598 FCB_READ_UTF8STRING(passDescription);
599 FCB_READ_ENUM(classCode);
600 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
601 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
602 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
603 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
604 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1440);
605 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
606 FCB_READ_CUSTOM(validityPeriodDetails);
607 FCB_READ_CONSTRAINED_INT(numberOfValidityDays, 0, 370);
608 FCB_READ_CONSTRAINED_INT(numberOfPossibleTrips, 1, 250);
609 FCB_READ_CONSTRAINED_INT(numberOfDaysOfTravel, 1, 250);
610 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, 370);
611 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(countries, 1, 250);
612 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedCarrierNum, 1, 32000);
613 FCB_READ_SEQUENCE_OF_IA5STRING(includedCarrierIA5);
614 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedCarrierNum, 1, 32000);
615 FCB_READ_SEQUENCE_OF_IA5STRING(excludedCarrierIA5);
616 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
617 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
618 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
619 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
620 FCB_READ_UNCONSTRAINED_INT(price);
621 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
622 FCB_READ_UTF8STRING(infoText);
623 FCB_READ_CUSTOM(extension);
624}
625
626QDateTime Fcb::PassData::validFrom(const QDateTime &issueingDateTime) const
627{
628 QDate date = issueingDateTime.date().addDays(validFromDay);
629 QTime time = validFromTimeIsSet() ? QTime(0, 0).addSecs(validFromTime * 60) : QTime();
630 if (validFromUTCOffsetIsSet()) {
631 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-validFromUTCOffset * 15 * 60));
632 }
633 return QDateTime(date, time);
634}
635
636QDateTime Fcb::PassData::validUntil(const QDateTime &issueingDateTime) const
637{
638 const auto validFromDt = validFrom(issueingDateTime);
639 QDate date = validFromDt.date().addDays(validUntilDay);
640 QTime time = validUntilDayIsSet() ? QTime(0, 0).addSecs(validUntilTime * 60) : QTime(23, 59, 59);
641 if (validUntilUTCOffsetIsSet()) {
642 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(-validUntilUTCOffset * 15 * 60));
643 }
644 if (validFromDt.timeSpec() == Qt::OffsetFromUTC) {
645 return QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(validFromDt.offsetFromUtc()));
646 }
647 return QDateTime(date, time);
648}
649
650void Fcb::VoucherData::decode(UPERDecoder &decoder)
651{
652 decodeSequence(decoder);
653 FCB_READ_IA5STRING(referenceIA5);
654 FCB_READ_UNCONSTRAINED_INT(referenceNum);
655 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
656 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
657 validFromYear = decoder.readConstrainedWholeNumber(2016, 2269);
658 validFromDay = decoder.readConstrainedWholeNumber(0, 370);
659 validUntilYear = decoder.readConstrainedWholeNumber(2016, 2269);
660 validUntilDay = decoder.readConstrainedWholeNumber(0, 370);
661 FCB_READ_UNCONSTRAINED_INT(value);
662 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
663 FCB_READ_UTF8STRING(infoText);
664 FCB_READ_CUSTOM(extension);
665}
666
667void Fcb::CustomerCardData::decode(UPERDecoder &decoder)
668{
669 decodeSequence(decoder);
670 FCB_READ_CUSTOM(customer);
671 FCB_READ_IA5STRING(cardIdIA5);
672 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
673 validFromYear = decoder.readConstrainedWholeNumber(2016, 2269);
674 FCB_READ_CONSTRAINED_INT(validFromDay, 0, 370);
675 FCB_READ_CONSTRAINED_INT(validUntilYear, 0, 250);
676 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
677 FCB_READ_ENUM(classCode);
678 FCB_READ_CONSTRAINED_INT(cardType, 1, 1000);
679 FCB_READ_UTF8STRING(cardTypeDescr);
680 FCB_READ_UNCONSTRAINED_INT(customerStatus);
681 FCB_READ_IA5STRING(customerStatusDescr);
682 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(includedServices);
683 FCB_READ_CUSTOM(extension);
684}
685
686QDate Fcb::CustomerCardData::validFrom() const
687{
688 QDate d(validFromYear, 1, 1);
689 if (validFromDayIsSet()) {
690 d = d.addDays(validFromDay);
691 }
692 return d;
693}
694
695QDate Fcb::CustomerCardData::validUntil() const
696{
697 QDate d(validFrom().year(), 1, 1);
698 d = d.addYears(validUntilYear);
699 if (validUntilDayIsSet()) {
700 d = d.addDays(validUntilDay);
701 }
702 return d;
703}
704
705void Fcb::CountermarkData::decode(UPERDecoder &decoder)
706{
707 decodeSequence(decoder);
708 FCB_READ_IA5STRING(referenceIA5);
709 FCB_READ_UNCONSTRAINED_INT(referenceNum);
710 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
711 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
712 FCB_READ_IA5STRING(ticketReferenceIA5);
713 FCB_READ_UNCONSTRAINED_INT(ticketReferenceNum);
714 numberOfCountermark = decoder.readConstrainedWholeNumber(1, 200);
715 totalOfCountermarks = decoder.readConstrainedWholeNumber(1, 200);
716 groupName = decoder.readUtf8String();
717 FCB_READ_ENUM(stationCodeTable);
718 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
719 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
720 FCB_READ_UTF8STRING(fromStationNameUTF8);
721 FCB_READ_UTF8STRING(toStationNameUTF8);
722 FCB_READ_UTF8STRING(validRegionDesc);
723 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
724 returnIncluded = decoder.readBoolean();
725 FCB_READ_CUSTOM(returnDescription);
726 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
727 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
728 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
729 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
730 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1440);
731 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
732 FCB_READ_ENUM(classCode);
733 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
734 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
735 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
736 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
737 FCB_READ_UTF8STRING(infoText);
738 FCB_READ_CUSTOM(extension);
739}
740
741void Fcb::ParkingGroundData::decode(UPERDecoder &decoder)
742{
743 decodeSequence(decoder);
744 FCB_READ_IA5STRING(referenceIA5);
745 FCB_READ_UNCONSTRAINED_INT(referenceNum);
746 parkingGroundId = decoder.readIA5String();
747 fromParkingDate = decoder.readConstrainedWholeNumber(-1, 370);
748 FCB_READ_CONSTRAINED_INT(untilParkingDate, 0, 370);
749 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
750 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
751 FCB_READ_IA5STRING(accessCode);
752 location = decoder.readUtf8String();
753 FCB_READ_ENUM(stationCodeTable);
754 FCB_READ_UNCONSTRAINED_INT(stationNum);
755 FCB_READ_UTF8STRING(stationIA5);
756 FCB_READ_UTF8STRING(specialInformation);
757 FCB_READ_UTF8STRING(entryTrack);
758 FCB_READ_IA5STRING(numberPlate);
759 FCB_READ_UNCONSTRAINED_INT(price);
760 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
761 FCB_READ_CUSTOM(extension);
762}
763
764void Fcb::FIPTicketData::decode(UPERDecoder &decoder)
765{
766 decodeSequence(decoder);
767 FCB_READ_IA5STRING(referenceIA5);
768 FCB_READ_UNCONSTRAINED_INT(referenceNum);
769 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
770 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
771 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
772 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
773 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, 370);
774 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
775 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
776 numberOfTravelDays = decoder.readConstrainedWholeNumber(1, 200);
777 includesSupplements = decoder.readBoolean();
778 FCB_READ_ENUM(classCode);
779 FCB_READ_CUSTOM(extension);
780}
781
782void Fcb::StationPassageData::decode(UPERDecoder &decoder)
783{
784 decodeSequence(decoder);
785 FCB_READ_IA5STRING(referenceIA5);
786 FCB_READ_UNCONSTRAINED_INT(referenceNum);
787 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
788 FCB_READ_INT_IA5_PAIR(productId, 0, 32000);
789 FCB_READ_UTF8STRING(productName);
790 FCB_READ_ENUM(stationCodeTable);
791 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(stationNum);
792 FCB_READ_SEQUENCE_OF_IA5STRING(stationIA5);
793 FCB_READ_SEQUENCE_OF_UTF8STRING(stationNameUTF8);
794 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(areaCodeNum);
795 FCB_READ_SEQUENCE_OF_IA5STRING(areaCodeIA5);
796 FCB_READ_SEQUENCE_OF_UTF8STRING(areaNameUTF8);
797 validFromDay = decoder.readConstrainedWholeNumber(-1, 700);
798 FCB_READ_CONSTRAINED_INT(validFromTime, 0, 1440);
799 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
800 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, 370);
801 FCB_READ_CONSTRAINED_INT(validUntilTime, 0, 1400);
802 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
803 FCB_READ_UNCONSTRAINED_INT(numberOfDaysValid);
804 FCB_READ_CUSTOM(extension);
805}
806
807void Fcb::DelayConfirmation::decode(UPERDecoder &decoder)
808{
809 decodeSequence(decoder);
810 FCB_READ_IA5STRING(referenceIA5);
811 FCB_READ_UNCONSTRAINED_INT(referenceNum);
812 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
813 FCB_READ_CONSTRAINED_INT(departureYear, 2016, 2269);
814 FCB_READ_CONSTRAINED_INT(departureDay, 1, 366);
815 FCB_READ_CONSTRAINED_INT(departureTime, 0, 1440);
816 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
817 FCB_READ_ENUM(stationCodeTable);
818 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
819 delay = decoder.readConstrainedWholeNumber(1, 999);
820 trainCancelled = decoder.readBoolean();
821 FCB_READ_ENUM(confirmationType);
822 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
823 FCB_READ_UTF8STRING(infoText);
824 FCB_READ_CUSTOM(extension);
825}
826
827void Fcb::TokenType::decode(UPERDecoder &decoder)
828{
829 decodeSequence(decoder);
830 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
831 FCB_READ_IA5STRING(tokenSpecification);
832 token = decoder.readOctetString();
833}
834
835void Fcb::DocumentData::decode(UPERDecoder &decoder)
836{
837 decodeSequence(decoder);
838 FCB_READ_CUSTOM(token);
839 ticket = decoder.readChoiceWithExtensionMarker<
840 ReservationData,
841 CarCarriageReservationData,
842 OpenTicketData,
843 PassData,
844 VoucherData,
845 CustomerCardData,
846 CountermarkData,
847 ParkingGroundData,
848 FIPTicketData,
849 StationPassageData,
850 ExtensionData,
851 DelayConfirmation
852 >();
853}
854
855void Fcb::TicketLinkType::decode(UPERDecoder &decoder)
856{
857 decodeSequence(decoder);
858 FCB_READ_IA5STRING(referenceIA5);
859 FCB_READ_UNCONSTRAINED_INT(referenceNum);
860 FCB_READ_UTF8STRING(issuerName);
861 FCB_READ_IA5STRING(issuerPNR);
862 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
863 FCB_READ_ENUM(ticketType);
864 FCB_READ_ENUM(linkMode);
865}
866
867void Fcb::ControlData::decode(UPERDecoder &decoder)
868{
869 decodeSequence(decoder);
870 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
871 identificationByIdCard = decoder.readBoolean();
872 identificationByPassportId = decoder.readBoolean();
873 FCB_READ_UNCONSTRAINED_INT(identificationItem);
874 passportValidationRequired = decoder.readBoolean();
875 onlineValidationRequired = decoder.readBoolean();
876 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
877 ageCheckRequired = decoder.readBoolean();
878 reductionCardCheckRequired = decoder.readBoolean();
879 FCB_READ_UTF8STRING(infoText);
880 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
881 FCB_READ_CUSTOM(extension);
882}
883
884Fcb::UicRailTicketData::UicRailTicketData() = default;
885
886Fcb::UicRailTicketData::UicRailTicketData(const Uic9183Block &block)
887 : m_block(block)
888{
889 if (block.isNull()) {
890 return;
891 }
892 UPERDecoder decoder(BitVectorView(std::string_view(block.content(), block.contentSize())));
893 decode(decoder);
894 if (decoder.hasError()) {
895 qCWarning(Log) << decoder.errorMessage();
896 m_block = {};
897 }
898}
899
900void Fcb::UicRailTicketData::decode(UPERDecoder &decoder)
901{
902 decodeSequence(decoder);
903 issuingDetail.decode(decoder);
904 FCB_READ_CUSTOM(travelerDetail);
905 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
906 FCB_READ_CUSTOM(controlDetail)
907}
908
909bool Fcb::UicRailTicketData::isValid() const
910{
911 return !m_block.isNull();
912}
913
914#include "moc_fcbticket.cpp"
Non-owning bit-level view for working with data that isn't byte-aligned.
Decoder for data encoded according to X.691 ASN.1 Unaligned Packed Encoding Rules (UPER).
Definition uperdecoder.h:17
QList< T > readSequenceOf()
Read a sequence-of field with unrestricted size.
Definition uperdecoder.h:76
T readEnumerated()
Read enumerated value.
Definition uperdecoder.h:97
int64_t readUnconstrainedWholeNumber()
Read unconstrained whole number.
QString readUtf8String()
Read UTF-8 string.
QVariant readChoiceWithExtensionMarker()
Read a choice value.
QByteArray readOctetString()
Read unconstrained octet string (8 bit data).
bool readBoolean()
Read boolean value.
bool hasError() const
Reading at any point encountered an error.
QByteArray readIA5String()
Read an unconstrained IA5String (7 bit ASCII).
int64_t readConstrainedWholeNumber(int64_t minimum, int64_t maximum)
Read constrained whole number from the current position.
A data block from a UIC 918.3 ticket.
int contentSize() const
Returns the size of the content data.
bool isNull() const
Checks if the block is valid or empty/default constructed.
const char * content() const
Returns the payload data (not including the block header).
Q_SCRIPTABLE CaptureState status()
QVariant location(const QVariant &res)
Returns the location of a non-transport reservation.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
QStringView country(QStringView ifopt)
QDate addDays(qint64 ndays) const const
QDate date() const const
OffsetFromUTC
QTime addSecs(int s) const const
QTimeZone fromSecondsAheadOfUtc(int offset)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.