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

KDE's Doxygen guidelines are available online.