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)
76constexpr inline auto FCB_TIME_MAX = 1440;
77#define FCB_READ_TIME(Name) \
78 FCB_READ_CONSTRAINED_INT(Name, 0, FCB_TIME_MAX)
84 decodeSequence(decoder);
89void Fcb::GeoCoordinateType::decode(
UPERDecoder &decoder)
91 decodeSequence(decoder);
92 FCB_READ_ENUM(geoUnit);
93 FCB_READ_ENUM(coordinateSystem);
94 FCB_READ_ENUM(hemisphereLongitude);
95 FCB_READ_ENUM(hemisphereLongitude);
98 FCB_READ_ENUM(accuracy);
101void Fcb::DeltaCoordinate::decode(
UPERDecoder &decoder)
103 decodeSequence(decoder);
110 decodeSequence(decoder);
111 FCB_READ_INT_IA5_PAIR(securityProvider, 1, 32000);
112 FCB_READ_INT_IA5_PAIR(issuer, 1, 32000);
115 FCB_READ_TIME(issuingTime);
116 FCB_READ_UTF8STRING(issuerName);
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);
129QDateTime Fcb::IssuingData::issueingDateTime()
const
131 QDate date(issuingYear, 1, 1);
132 date = date.addDays(issuingDay - 1);
133 if (issuingTimeIsSet()) {
139void Fcb::CustomerStatusType::decode(
UPERDecoder &decoder)
141 decodeSequence(decoder);
142 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(statusProvider);
143 FCB_READ_UNCONSTRAINED_INT(customerStatus);
144 FCB_READ_IA5STRING(customerStatusDescr);
147void Fcb::TravelerType::decode(
UPERDecoder &decoder)
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);
162 FCB_READ_ENUM(passengerType);
163 if (passengerWithReducedMobilityIsSet()) {
164 passengerWithReducedMobility = decoder.
readBoolean();
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);
172void Fcb::TravelerData::decode(
UPERDecoder &decoder)
174 decodeSequence(decoder);
175 FCB_READ_SEQUENCE_OF_CUSTOM(traveler);
176 FCB_READ_IA5STRING_CONSTRAINED(preferredLanguage, 2, 2);
177 FCB_READ_UTF8STRING(groupName);
180void Fcb::TrainLinkType::decode(
UPERDecoder &decoder)
182 decodeSequence(decoder);
183 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
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);
193QDateTime Fcb::TrainLinkType::departureDateTime(
const QDateTime &issueingDateTime)
const
197 if (departureUTCOffsetIsSet()) {
203void Fcb::ViaStationType::decode(
UPERDecoder &decoder)
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);
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);
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);
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);
242void Fcb::PolygoneType::decode(
UPERDecoder &decoder)
244 decodeSequence(decoder);
245 firstEdge.decode(decoder);
249void Fcb::RegionalValidityType::decode(
UPERDecoder &decoder)
254void Fcb::ReturnRouteDescriptionType::decode(
UPERDecoder &decoder)
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);
265void Fcb::RouteSectionType::decode(
UPERDecoder &decoder)
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);
275void Fcb::SeriesDetailType::decode(
UPERDecoder &decoder)
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);
283void Fcb::CardReferenceType::decode(
UPERDecoder &decoder)
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);
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);
304void Fcb::CompartmentDetailsType::decode(
UPERDecoder &decoder)
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);
316void Fcb::BerthDetailData::decode(
UPERDecoder &decoder)
318 decodeSequence(decoder);
321 FCB_READ_ENUM(gender);
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);
340void Fcb::VatDetailType::decode(
UPERDecoder &decoder)
342 decodeSequence(decoder);
345 FCB_READ_UNCONSTRAINED_INT(amount);
346 FCB_READ_IA5STRING(vatId);
349void Fcb::IncludedOpenTicketType::decode(
UPERDecoder &decoder)
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);
375void Fcb::RegisteredLuggageType::decode(
UPERDecoder &decoder)
377 decodeSequence(decoder);
378 FCB_READ_IA5STRING(registrationId);
379 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
380 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
383void Fcb::LuggageRestrictionType::decode(
UPERDecoder &decoder)
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);
391void Fcb::ReservationData::decode(
UPERDecoder &decoder)
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);
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);
435QDateTime Fcb::ReservationData::departureDateTime(
const QDateTime &issueingDateTime)
const
439 if (departureUTCOffsetIsSet()) {
445QDateTime Fcb::ReservationData::arrivalDateTime(
const QDateTime &issueingDateTime)
const
447 if (!arrivalTimeIsSet()) {
450 const auto departureDt = departureDateTime(issueingDateTime);
453 if (arrivalUTCOffsetIsSet()) {
462void Fcb::CarCarriageReservationData::decode(
UPERDecoder &decoder)
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);
488 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
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);
507void Fcb::OpenTicketData::decode(
UPERDecoder &decoder)
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);
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);
550 if (validFromUTCOffsetIsSet()) {
558 const auto validFromDt = validFrom(issueingDateTime);
561 if (validUntilUTCOffsetIsSet()) {
570void Fcb::TimeRangeType::decode(
UPERDecoder &decoder)
572 decodeSequence(decoder);
577void Fcb::ValidityPeriodType::decode(
UPERDecoder &decoder)
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);
588void Fcb::ValidityPeriodDetailType::decode(
UPERDecoder &decoder)
590 decodeSequence(decoder);
591 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
592 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
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);
634 if (validFromUTCOffsetIsSet()) {
642 const auto validFromDt = validFrom(issueingDateTime);
645 if (validUntilUTCOffsetIsSet()) {
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);
665 FCB_READ_UNCONSTRAINED_INT(value);
666 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
667 FCB_READ_UTF8STRING(infoText);
668 FCB_READ_CUSTOM(extension);
671void Fcb::CustomerCardData::decode(
UPERDecoder &decoder)
673 decodeSequence(decoder);
674 FCB_READ_CUSTOM(customer);
675 FCB_READ_IA5STRING(cardIdIA5);
676 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
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);
690QDate Fcb::CustomerCardData::validFrom()
const
692 QDate d(validFromYear, 1, 1);
693 if (validFromDayIsSet()) {
694 d = d.addDays(validFromDay);
699QDate Fcb::CustomerCardData::validUntil()
const
701 QDate d(validFrom().year(), 1, 1);
702 d = d.addYears(validUntilYear);
703 if (validUntilDayIsSet()) {
704 d = d.addDays(validUntilDay);
709void Fcb::CountermarkData::decode(
UPERDecoder &decoder)
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);
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);
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);
745void Fcb::ParkingGroundData::decode(
UPERDecoder &decoder)
747 decodeSequence(decoder);
748 FCB_READ_IA5STRING(referenceIA5);
749 FCB_READ_UNCONSTRAINED_INT(referenceNum);
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);
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);
768void Fcb::FIPTicketData::decode(
UPERDecoder &decoder)
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);
782 FCB_READ_ENUM(classCode);
783 FCB_READ_CUSTOM(extension);
786void Fcb::StationPassageData::decode(
UPERDecoder &decoder)
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);
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);
811void Fcb::DelayConfirmation::decode(
UPERDecoder &decoder)
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);
825 FCB_READ_ENUM(confirmationType);
826 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
827 FCB_READ_UTF8STRING(infoText);
828 FCB_READ_CUSTOM(extension);
833 decodeSequence(decoder);
834 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
835 FCB_READ_IA5STRING(tokenSpecification);
839void Fcb::DocumentData::decode(
UPERDecoder &decoder)
841 decodeSequence(decoder);
842 FCB_READ_CUSTOM(token);
845 CarCarriageReservationData,
859void Fcb::TicketLinkType::decode(
UPERDecoder &decoder)
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);
873 decodeSequence(decoder);
874 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
876 identificationByPassportId = decoder.
readBoolean();
877 FCB_READ_UNCONSTRAINED_INT(identificationItem);
878 passportValidationRequired = decoder.
readBoolean();
880 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
882 reductionCardCheckRequired = decoder.
readBoolean();
883 FCB_READ_UTF8STRING(infoText);
884 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
885 FCB_READ_CUSTOM(extension);
888Fcb::UicRailTicketData::UicRailTicketData() =
default;
890Fcb::UicRailTicketData::UicRailTicketData(
const Uic9183Block &block)
899 qCWarning(Log) << decoder.errorMessage();
904void Fcb::UicRailTicketData::decode(
UPERDecoder &decoder)
906 decodeSequence(decoder);
907 issuingDetail.decode(decoder);
908 FCB_READ_CUSTOM(travelerDetail);
909 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
910 FCB_READ_CUSTOM(controlDetail)
913bool Fcb::UicRailTicketData::isValid()
const
915 return !m_block.isNull();
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).
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)