9#include "asn1/uperdecoder.h"
11#define FCB_READ_CONSTRAINED_INT(Name, Min, Max) \
12 if (Name ## IsSet()) \
13 Name = decoder.readConstrainedWholeNumber(Min, Max)
15#define FCB_READ_UNCONSTRAINED_INT(Name) \
16 if (Name ## IsSet()) \
17 Name = decoder.readUnconstrainedWholeNumber()
19#define FCB_READ_IA5STRING(Name) \
20 if (Name ## IsSet()) \
21 Name = decoder.readIA5String()
23#define FCB_READ_IA5STRING_CONSTRAINED(Name, Min, Max) \
24 if (Name ## IsSet()) \
25 Name = decoder.readIA5String(Min, Max)
27#define FCB_READ_UTF8STRING(Name) \
28 if (Name ## IsSet()) \
29 Name = decoder.readUtf8String()
31#define FCB_READ_OCTETSTRING(Name) \
32 if (Name ## IsSet()) \
33 Name = decoder.readOctetString()
35#define FCB_READ_ENUM(Name) \
36 do { if (Name ## IsSet()) { \
37 if constexpr (uperHasExtensionMarker(decltype(Name){})) { \
38 Name = decoder.readEnumeratedWithExtensionMarker<decltype(Name)>(); \
40 Name = decoder.readEnumerated<decltype(Name)>(); \
44#define FCB_READ_CUSTOM(Name) \
45 if (Name ## IsSet()) \
48#define FCB_READ_SEQUENCE_OF_CONTRAINED_INT(Name, Min, Max) \
49 if (Name ## IsSet()) \
50 Name = decoder.readSequenceOfConstrainedWholeNumber(Min, Max)
52#define FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(Name) \
53 if (Name ## IsSet()) \
54 Name = decoder.readSequenceOfUnconstrainedWholeNumber()
56#define FCB_READ_SEQUENCE_OF_IA5STRING(Name) \
57 if (Name ## IsSet()) \
58 Name = decoder.readSequenceOfIA5String()
60#define FCB_READ_SEQUENCE_OF_UTF8STRING(Name) \
61 if (Name ## IsSet()) \
62 Name = decoder.readSequenceOfUtf8String()
64#define FCB_READ_SEQUENCE_OF_CUSTOM(Name) \
65 if (Name ## IsSet()) \
66 Name = decoder.readSequenceOf<decltype(Name)::value_type>();
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)
72#define FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(Name) \
73 FCB_READ_UNCONSTRAINED_INT(Name ## Num); \
74 FCB_READ_IA5STRING(Name ## IA5)
80 decodeSequence(decoder);
85void Fcb::GeoCoordinateType::decode(
UPERDecoder &decoder)
87 decodeSequence(decoder);
88 FCB_READ_ENUM(geoUnit);
89 FCB_READ_ENUM(coordinateSystem);
90 FCB_READ_ENUM(hemisphereLongitude);
91 FCB_READ_ENUM(hemisphereLongitude);
94 FCB_READ_ENUM(accuracy);
97void Fcb::DeltaCoordinate::decode(
UPERDecoder &decoder)
99 decodeSequence(decoder);
106 decodeSequence(decoder);
107 FCB_READ_INT_IA5_PAIR(securityProvider, 1, 32000);
108 FCB_READ_INT_IA5_PAIR(issuer, 1, 32000);
111 FCB_READ_CONSTRAINED_INT(issuingTime, 0, 1440);
112 FCB_READ_UTF8STRING(issuerName);
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);
125QDateTime Fcb::IssuingData::issueingDateTime()
const
127 QDate date(issuingYear, 1, 1);
128 date = date.addDays(issuingDay - 1);
129 if (issuingTimeIsSet()) {
135void Fcb::CustomerStatusType::decode(
UPERDecoder &decoder)
137 decodeSequence(decoder);
138 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(statusProvider);
139 FCB_READ_UNCONSTRAINED_INT(customerStatus);
140 FCB_READ_IA5STRING(customerStatusDescr);
143void Fcb::TravelerType::decode(
UPERDecoder &decoder)
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);
158 FCB_READ_ENUM(passengerType);
159 if (passengerWithReducedMobilityIsSet()) {
160 passengerWithReducedMobility = decoder.
readBoolean();
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);
168void Fcb::TravelerData::decode(
UPERDecoder &decoder)
170 decodeSequence(decoder);
171 FCB_READ_SEQUENCE_OF_CUSTOM(traveler);
172 FCB_READ_IA5STRING_CONSTRAINED(preferredLanguage, 2, 2);
173 FCB_READ_UTF8STRING(groupName);
176void Fcb::TrainLinkType::decode(
UPERDecoder &decoder)
178 decodeSequence(decoder);
179 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
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);
189QDateTime Fcb::TrainLinkType::departureDateTime(
const QDateTime &issueingDateTime)
const
193 if (departureUTCOffsetIsSet()) {
199void Fcb::ViaStationType::decode(
UPERDecoder &decoder)
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);
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);
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);
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);
238void Fcb::PolygoneType::decode(
UPERDecoder &decoder)
240 decodeSequence(decoder);
241 firstEdge.decode(decoder);
245void Fcb::RegionalValidityType::decode(
UPERDecoder &decoder)
250void Fcb::ReturnRouteDescriptionType::decode(
UPERDecoder &decoder)
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);
261void Fcb::RouteSectionType::decode(
UPERDecoder &decoder)
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);
271void Fcb::SeriesDetailType::decode(
UPERDecoder &decoder)
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);
279void Fcb::CardReferenceType::decode(
UPERDecoder &decoder)
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);
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);
300void Fcb::CompartmentDetailsType::decode(
UPERDecoder &decoder)
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);
312void Fcb::BerthDetailData::decode(
UPERDecoder &decoder)
314 decodeSequence(decoder);
317 FCB_READ_ENUM(gender);
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);
336void Fcb::VatDetailType::decode(
UPERDecoder &decoder)
338 decodeSequence(decoder);
341 FCB_READ_UNCONSTRAINED_INT(amount);
342 FCB_READ_IA5STRING(vatId);
345void Fcb::IncludedOpenTicketType::decode(
UPERDecoder &decoder)
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);
371void Fcb::RegisteredLuggageType::decode(
UPERDecoder &decoder)
373 decodeSequence(decoder);
374 FCB_READ_IA5STRING(registrationId);
375 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
376 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
379void Fcb::LuggageRestrictionType::decode(
UPERDecoder &decoder)
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);
387void Fcb::ReservationData::decode(
UPERDecoder &decoder)
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);
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);
431QDateTime Fcb::ReservationData::departureDateTime(
const QDateTime &issueingDateTime)
const
435 if (departureUTCOffsetIsSet()) {
441QDateTime Fcb::ReservationData::arrivalDateTime(
const QDateTime &issueingDateTime)
const
443 if (!arrivalTimeIsSet()) {
446 const auto departureDt = departureDateTime(issueingDateTime);
449 if (arrivalUTCOffsetIsSet()) {
458void Fcb::CarCarriageReservationData::decode(
UPERDecoder &decoder)
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);
484 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
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);
503void Fcb::OpenTicketData::decode(
UPERDecoder &decoder)
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);
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);
546 if (validFromUTCOffsetIsSet()) {
554 const auto validFromDt = validFrom(issueingDateTime);
557 if (validUntilUTCOffsetIsSet()) {
566void Fcb::TimeRangeType::decode(
UPERDecoder &decoder)
568 decodeSequence(decoder);
573void Fcb::ValidityPeriodType::decode(
UPERDecoder &decoder)
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);
584void Fcb::ValidityPeriodDetailType::decode(
UPERDecoder &decoder)
586 decodeSequence(decoder);
587 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
588 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
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);
630 if (validFromUTCOffsetIsSet()) {
638 const auto validFromDt = validFrom(issueingDateTime);
641 if (validUntilUTCOffsetIsSet()) {
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);
661 FCB_READ_UNCONSTRAINED_INT(value);
662 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
663 FCB_READ_UTF8STRING(infoText);
664 FCB_READ_CUSTOM(extension);
667void Fcb::CustomerCardData::decode(
UPERDecoder &decoder)
669 decodeSequence(decoder);
670 FCB_READ_CUSTOM(customer);
671 FCB_READ_IA5STRING(cardIdIA5);
672 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
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);
686QDate Fcb::CustomerCardData::validFrom()
const
688 QDate d(validFromYear, 1, 1);
689 if (validFromDayIsSet()) {
690 d = d.addDays(validFromDay);
695QDate Fcb::CustomerCardData::validUntil()
const
697 QDate d(validFrom().year(), 1, 1);
698 d = d.addYears(validUntilYear);
699 if (validUntilDayIsSet()) {
700 d = d.addDays(validUntilDay);
705void Fcb::CountermarkData::decode(
UPERDecoder &decoder)
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);
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);
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);
741void Fcb::ParkingGroundData::decode(
UPERDecoder &decoder)
743 decodeSequence(decoder);
744 FCB_READ_IA5STRING(referenceIA5);
745 FCB_READ_UNCONSTRAINED_INT(referenceNum);
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);
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);
764void Fcb::FIPTicketData::decode(
UPERDecoder &decoder)
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);
778 FCB_READ_ENUM(classCode);
779 FCB_READ_CUSTOM(extension);
782void Fcb::StationPassageData::decode(
UPERDecoder &decoder)
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);
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);
807void Fcb::DelayConfirmation::decode(
UPERDecoder &decoder)
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);
821 FCB_READ_ENUM(confirmationType);
822 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
823 FCB_READ_UTF8STRING(infoText);
824 FCB_READ_CUSTOM(extension);
829 decodeSequence(decoder);
830 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
831 FCB_READ_IA5STRING(tokenSpecification);
835void Fcb::DocumentData::decode(
UPERDecoder &decoder)
837 decodeSequence(decoder);
838 FCB_READ_CUSTOM(token);
841 CarCarriageReservationData,
855void Fcb::TicketLinkType::decode(
UPERDecoder &decoder)
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);
869 decodeSequence(decoder);
870 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
872 identificationByPassportId = decoder.
readBoolean();
873 FCB_READ_UNCONSTRAINED_INT(identificationItem);
874 passportValidationRequired = decoder.
readBoolean();
876 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
878 reductionCardCheckRequired = decoder.
readBoolean();
879 FCB_READ_UTF8STRING(infoText);
880 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
881 FCB_READ_CUSTOM(extension);
884Fcb::UicRailTicketData::UicRailTicketData() =
default;
886Fcb::UicRailTicketData::UicRailTicketData(
const Uic9183Block &block)
895 qCWarning(Log) << decoder.errorMessage();
900void Fcb::UicRailTicketData::decode(
UPERDecoder &decoder)
902 decodeSequence(decoder);
903 issuingDetail.decode(decoder);
904 FCB_READ_CUSTOM(travelerDetail);
905 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
906 FCB_READ_CUSTOM(controlDetail)
909bool Fcb::UicRailTicketData::isValid()
const
911 return !m_block.isNull();
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).
QList< T > readSequenceOf()
Read a sequence-of field with unrestricted size.
T readEnumerated()
Read enumerated value.
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.
KI18NLOCALEDATA_EXPORT KCountry country(const char *ianaId)
QDate addDays(qint64 ndays) const const
QTime addSecs(int s) const const
QTimeZone fromSecondsAheadOfUtc(int offset)