7#include "fcbreader_p.h"
11#include "asn1/uperdecoder.h"
13constexpr inline auto FCB_TIME_MAX = 1440;
14constexpr inline auto FCB_BEGIN_DATE_MIN = -1;
15constexpr inline auto FCB_END_DATE_MIN = 0;
16constexpr inline auto FCB_DATE_MAX = 370;
18constexpr inline auto FCB_PRODUCT_ID_NUM_MAX = 32000;
24 decodeSequence(decoder);
29void Fcb::v13::GeoCoordinateType::decode(UPERDecoder &decoder)
31 decodeSequence(decoder);
32 FCB_READ_ENUM(geoUnit);
33 FCB_READ_ENUM(coordinateSystem);
34 FCB_READ_ENUM(hemisphereLongitude);
35 FCB_READ_ENUM(hemisphereLongitude);
38 FCB_READ_ENUM(accuracy);
41void Fcb::v13::DeltaCoordinate::decode(UPERDecoder &decoder)
43 decodeSequence(decoder);
48void Fcb::v13::IssuingData::decode(UPERDecoder &decoder)
50 decodeSequence(decoder);
51 FCB_READ_INT_IA5_PAIR(securityProvider, 1, 32000);
52 FCB_READ_INT_IA5_PAIR(issuer, 1, 32000);
55 FCB_READ_TIME(issuingTime);
56 FCB_READ_UTF8STRING(issuerName);
60 FCB_READ_IA5STRING_CONSTRAINED(currency, 3, 3);
61 FCB_READ_CONSTRAINED_INT(currencyFract, 1, 3);
62 FCB_READ_IA5STRING(issuerPNR);
63 FCB_READ_CUSTOM(extension);
64 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(issuedOnTrain);
65 FCB_READ_UNCONSTRAINED_INT(issuedOnLine);
66 FCB_READ_CUSTOM(pointOfSale);
69QDateTime Fcb::v13::IssuingData::issueingDateTime()
const
74void Fcb::v13::CustomerStatusType::decode(UPERDecoder &decoder)
76 decodeSequence(decoder);
77 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(statusProvider);
78 FCB_READ_UNCONSTRAINED_INT(customerStatus);
79 FCB_READ_IA5STRING(customerStatusDescr);
82void Fcb::v13::TravelerType::decode(UPERDecoder &decoder)
84 decodeSequence(decoder);
85 FCB_READ_UTF8STRING(firstName);
86 FCB_READ_UTF8STRING(secondName);
87 FCB_READ_UTF8STRING(lastName);
88 FCB_READ_IA5STRING(idCard);
89 FCB_READ_IA5STRING(passportId);
90 FCB_READ_IA5STRING(title);
91 FCB_READ_ENUM(gender);
92 FCB_READ_IA5STRING(customerIdIA5);
93 FCB_READ_UNCONSTRAINED_INT(customerIdNum);
94 FCB_READ_CONSTRAINED_INT(yearOfBirth, 1901, 2155);
95 FCB_READ_CONSTRAINED_INT(dayOfBirth, 0, 370);
97 FCB_READ_ENUM(passengerType);
98 if (passengerWithReducedMobilityIsSet()) {
99 passengerWithReducedMobility = decoder.
readBoolean();
101 FCB_READ_CONSTRAINED_INT(countryOfResidence, 1, 999);
102 FCB_READ_CONSTRAINED_INT(countryOfPassport, 1, 999);
103 FCB_READ_CONSTRAINED_INT(countryOfIdCard, 1, 999);
104 FCB_READ_SEQUENCE_OF_CUSTOM(
status);
107void Fcb::v13::TravelerData::decode(UPERDecoder &decoder)
109 decodeSequence(decoder);
110 FCB_READ_SEQUENCE_OF_CUSTOM(traveler);
111 FCB_READ_IA5STRING_CONSTRAINED(preferredLanguage, 2, 2);
112 FCB_READ_UTF8STRING(groupName);
115void Fcb::v13::TrainLinkType::decode(UPERDecoder &decoder)
117 decodeSequence(decoder);
118 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
120 FCB_READ_TIME(departureTime);
121 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
122 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
123 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
124 FCB_READ_UTF8STRING(fromStationNameUTF8);
125 FCB_READ_UTF8STRING(toStationNameUTF8);
128QDateTime Fcb::v13::TrainLinkType::departureDateTime(
const QDateTime &issueingDateTime)
const
133void Fcb::v13::ViaStationType::decode(UPERDecoder &decoder)
135 decodeSequence(decoder);
136 FCB_READ_ENUM(stationCodeTable);
137 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
138 FCB_READ_SEQUENCE_OF_CUSTOM(alternativeRoutes);
139 FCB_READ_SEQUENCE_OF_CUSTOM(route);
141 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
142 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
143 FCB_READ_UNCONSTRAINED_INT(seriesId);
144 FCB_READ_UNCONSTRAINED_INT(routeId);
147void Fcb::v13::ZoneType::decode(UPERDecoder &decoder)
149 decodeSequence(decoder);
150 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
151 FCB_READ_ENUM(stationCodeTable);
152 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
153 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
154 FCB_READ_UNCONSTRAINED_INT(city);
155 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(zoneId);
156 FCB_READ_OCTETSTRING(binaryZoneId);
157 FCB_READ_IA5STRING(nutsCode);
160void Fcb::v13::LineType::decode(UPERDecoder &decoder)
162 decodeSequence(decoder);
163 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
164 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(lineId);
165 FCB_READ_ENUM(stationCodeTable);
166 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
167 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
168 FCB_READ_CONSTRAINED_INT(city, 1, 9999999);
169 FCB_READ_OCTETSTRING(binaryZoneId);
172void Fcb::v13::PolygoneType::decode(UPERDecoder &decoder)
174 decodeSequence(decoder);
175 firstEdge.decode(decoder);
179void Fcb::v13::RegionalValidityType::decode(UPERDecoder &decoder)
184void Fcb::v13::ReturnRouteDescriptionType::decode(UPERDecoder &decoder)
186 decodeSequence(decoder);
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 FCB_READ_UTF8STRING(validReturnRegionDesc);
192 FCB_READ_SEQUENCE_OF_CUSTOM(validReturnRegion);
195void Fcb::v13::RouteSectionType::decode(UPERDecoder &decoder)
197 decodeSequence(decoder);
198 FCB_READ_ENUM(stationCodeTable);
199 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
200 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
201 FCB_READ_UTF8STRING(fromStationNameUTF8);
202 FCB_READ_UTF8STRING(toStationNameUTF8);
205void Fcb::v13::SeriesDetailType::decode(UPERDecoder &decoder)
207 decodeSequence(decoder);
208 FCB_READ_CONSTRAINED_INT(supplyingCarrier, 1, 32000);
209 FCB_READ_CONSTRAINED_INT(offerIdentification, 1, 99);
210 FCB_READ_UNCONSTRAINED_INT(series);
213void Fcb::v13::CardReferenceType::decode(UPERDecoder &decoder)
215 decodeSequence(decoder);
216 FCB_READ_INT_IA5_PAIR(cardIssuer, 1, 32000);
217 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(cardId);
218 FCB_READ_UTF8STRING(cardName);
219 FCB_READ_UNCONSTRAINED_INT(cardType);
220 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(leadingCardId);
221 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(trailingCardId);
224void Fcb::v13::PlacesType::decode(KItinerary::UPERDecoder &decoder)
226 decodeSequence(decoder);
227 FCB_READ_IA5STRING(coach);
228 FCB_READ_IA5STRING(placeString);
229 FCB_READ_UTF8STRING(placeDescription);
230 FCB_READ_SEQUENCE_OF_IA5STRING(placeIA5);
231 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(placeNum, 1, 254);
234void Fcb::v13::CompartmentDetailsType::decode(UPERDecoder &decoder)
236 decodeSequence(decoder);
237 FCB_READ_CONSTRAINED_INT(coachType, 1, 99);
238 FCB_READ_CONSTRAINED_INT(compartmentType, 1, 99);
239 FCB_READ_CONSTRAINED_INT(specialAllocation, 1, 99);
240 FCB_READ_UTF8STRING(coachTypeDescr);
241 FCB_READ_UTF8STRING(compartmentTypeDescr);
242 FCB_READ_UTF8STRING(specialAllocationDescr);
243 FCB_READ_ENUM(position);
246void Fcb::v13::BerthDetailData::decode(UPERDecoder &decoder)
248 decodeSequence(decoder);
251 FCB_READ_ENUM(gender);
254void Fcb::v13::TariffType::decode(UPERDecoder &decoder)
256 decodeSequence(decoder);
257 FCB_READ_CONSTRAINED_INT(numberOfPassengers, 1, 200);
258 FCB_READ_ENUM(passengerType);
259 FCB_READ_CONSTRAINED_INT(ageBelow, 1, 64);
260 FCB_READ_CONSTRAINED_INT(ageAbove, 1, 128);
261 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(travelerid, 0, 254);
262 restrictedToCountryOfResidence = decoder.
readBoolean();
263 FCB_READ_CUSTOM(restrictedToRouteSection);
264 FCB_READ_CUSTOM(seriesDataDetails);
265 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tariffId);
266 FCB_READ_UTF8STRING(tariffDesc);
267 FCB_READ_SEQUENCE_OF_CUSTOM(reductionCard);
270void Fcb::v13::VatDetailType::decode(UPERDecoder &decoder)
272 decodeSequence(decoder);
275 FCB_READ_UNCONSTRAINED_INT(amount);
276 FCB_READ_IA5STRING(vatId);
279void Fcb::v13::IncludedOpenTicketType::decode(UPERDecoder &decoder)
281 decodeSequence(decoder);
282 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
283 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
284 FCB_READ_UNCONSTRAINED_INT(externalIssuerId);
285 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
286 FCB_READ_ENUM(stationCodeTable);
287 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
288 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
289 FCB_READ_TIME(validFromTime);
290 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
291 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
292 FCB_READ_TIME(validUntilTime);
293 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
294 FCB_READ_ENUM(classCode);
295 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
296 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
297 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
298 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
299 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
300 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
301 FCB_READ_UTF8STRING(infoText);
302 FCB_READ_CUSTOM(extension);
305void Fcb::v13::RegisteredLuggageType::decode(UPERDecoder &decoder)
307 decodeSequence(decoder);
308 FCB_READ_IA5STRING(registrationId);
309 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
310 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
313void Fcb::v13::LuggageRestrictionType::decode(UPERDecoder &decoder)
315 decodeSequence(decoder);
316 FCB_READ_CONSTRAINED_INT(maxHandLuggagePieces, 0, 99);
317 FCB_READ_CONSTRAINED_INT(maxNonHandLuggagePieces, 0, 99);
318 FCB_READ_SEQUENCE_OF_CUSTOM(registeredLuggage);
321void Fcb::v13::ReservationData::decode(UPERDecoder &decoder)
323 decodeSequence(decoder);
324 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
325 FCB_READ_CONSTRAINED_INT(departureDate, -1, FCB_DATE_MAX);
326 FCB_READ_IA5STRING(referenceIA5);
327 FCB_READ_UNCONSTRAINED_INT(referenceNum);
328 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
329 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
330 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
331 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
332 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
333 FCB_READ_ENUM(service);
334 FCB_READ_ENUM(stationCodeTable);
335 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
336 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
337 FCB_READ_UTF8STRING(fromStationNameUTF8);
338 FCB_READ_UTF8STRING(toStationNameUTF8);
339 FCB_READ_TIME(departureTime);
340 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
341 FCB_READ_CONSTRAINED_INT(arrivalDate, FCB_END_DATE_MIN, 20);
342 FCB_READ_TIME(arrivalTime);
343 FCB_READ_CONSTRAINED_INT(arrivalUTCOffset, -60, 60);
344 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
345 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
346 FCB_READ_ENUM(classCode);
347 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
348 FCB_READ_CUSTOM(places);
349 FCB_READ_CUSTOM(additionalPlaces);
350 FCB_READ_CUSTOM(bicyclePlaces);
351 FCB_READ_CUSTOM(compartmentDetails);
352 FCB_READ_CONSTRAINED_INT(numberOfOverbooked, 0, 200);
353 FCB_READ_SEQUENCE_OF_CUSTOM(berth);
354 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
355 FCB_READ_ENUM(priceType);
356 FCB_READ_UNCONSTRAINED_INT(price);
357 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
358 FCB_READ_CONSTRAINED_INT(typeOfSupplement, 0, 9);
359 FCB_READ_CONSTRAINED_INT(numberOfSupplements, 0, 200);
360 FCB_READ_CUSTOM(luggage);
361 FCB_READ_UTF8STRING(infoText);
362 FCB_READ_CUSTOM(extension);
365QDateTime Fcb::v13::ReservationData::departureDateTime(
const QDateTime &issueingDateTime)
const
370QDateTime Fcb::v13::ReservationData::arrivalDateTime(
const QDateTime &issueingDateTime)
const
375void Fcb::v13::CarCarriageReservationData::decode(UPERDecoder &decoder)
377 decodeSequence(decoder);
378 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
379 FCB_READ_CONSTRAINED_INT(beginLoadingDate, -1, FCB_DATE_MAX);
380 FCB_READ_TIME(beginLoadingTime);
381 FCB_READ_TIME(endLoadingTime);
382 FCB_READ_CONSTRAINED_INT(loadingUTCOffset, -60, 60);
383 FCB_READ_IA5STRING(referenceIA5);
384 FCB_READ_UNCONSTRAINED_INT(referenceNum);
385 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
386 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
387 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
388 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
389 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
390 FCB_READ_ENUM(stationCodeTable);
391 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
392 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
393 FCB_READ_UTF8STRING(fromStationNameUTF8);
394 FCB_READ_UTF8STRING(toStationNameUTF8);
395 FCB_READ_IA5STRING(coach);
396 FCB_READ_IA5STRING(place);
397 FCB_READ_CUSTOM(compartmentDetails);
398 FCB_READ_IA5STRING(numberPlate);
399 FCB_READ_IA5STRING(trailerPlate);
401 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
403 FCB_READ_ENUM(roofRackType);
404 FCB_READ_CONSTRAINED_INT(roofRackHeight, 0, 99);
405 FCB_READ_CONSTRAINED_INT(attachedBoats, 0, 2);
406 FCB_READ_CONSTRAINED_INT(attachedBicycles, 0, 4);
407 FCB_READ_CONSTRAINED_INT(attachedSurfboards, 0, 5);
408 FCB_READ_CONSTRAINED_INT(loadingListEntry, 0, 999);
409 FCB_READ_ENUM(loadingDeck);
410 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
411 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
412 tariff.decode(decoder);
413 FCB_READ_ENUM(priceType);
414 FCB_READ_UNCONSTRAINED_INT(price);
415 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
416 FCB_READ_UTF8STRING(infoText);
417 FCB_READ_CUSTOM(extension);
420void Fcb::v13::OpenTicketData::decode(UPERDecoder &decoder)
422 decodeSequence(decoder);
423 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
424 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
425 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
426 FCB_READ_UNCONSTRAINED_INT(extIssuerId);
427 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
429 FCB_READ_ENUM(stationCodeTable);
430 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
431 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
432 FCB_READ_UTF8STRING(fromStationNameUTF8);
433 FCB_READ_UTF8STRING(toStationNameUTF8);
434 FCB_READ_UTF8STRING(validRegionDesc);
435 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
436 FCB_READ_CUSTOM(returnDescription);
437 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
438 FCB_READ_TIME(validFromTime);
439 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
440 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
441 FCB_READ_TIME(validUntilTime);
442 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
443 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
444 FCB_READ_ENUM(classCode);
445 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
446 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
447 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
448 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
449 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
450 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
451 FCB_READ_UNCONSTRAINED_INT(price);
452 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
453 FCB_READ_UTF8STRING(infoText);
454 FCB_READ_SEQUENCE_OF_CUSTOM(includedAddOns);
455 FCB_READ_CUSTOM(luggage);
456 FCB_READ_CUSTOM(extension);
459QDateTime Fcb::v13::OpenTicketData::validFrom(
const QDateTime &issueingDateTime)
const
461 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
464QDateTime Fcb::v13::OpenTicketData::validUntil(
const QDateTime &issueingDateTime)
const
466 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validFromUTCOffsetValue());
469void Fcb::v13::TimeRangeType::decode(UPERDecoder &decoder)
471 decodeSequence(decoder);
472 FCB_READ_TIME(fromTime);
473 FCB_READ_TIME(untilTime);
476void Fcb::v13::ValidityPeriodType::decode(UPERDecoder &decoder)
478 decodeSequence(decoder);
479 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
480 FCB_READ_TIME(validFromTime);
481 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
482 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
483 FCB_READ_TIME(validUntilTime);
484 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
487void Fcb::v13::ValidityPeriodDetailType::decode(UPERDecoder &decoder)
489 decodeSequence(decoder);
490 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
491 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
494void Fcb::v13::PassData::decode(UPERDecoder &decoder)
496 decodeSequence(decoder);
497 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
498 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
499 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
500 FCB_READ_CONSTRAINED_INT(passType, 1, 250);
501 FCB_READ_UTF8STRING(passDescription);
502 FCB_READ_ENUM(classCode);
503 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
504 FCB_READ_TIME(validFromTime);
505 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
506 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
507 FCB_READ_TIME(validUntilTime);
508 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
509 FCB_READ_CUSTOM(validityPeriodDetails);
510 FCB_READ_CONSTRAINED_INT(numberOfValidityDays, 0, FCB_DATE_MAX);
511 FCB_READ_CONSTRAINED_INT(numberOfPossibleTrips, 1, 250);
512 FCB_READ_CONSTRAINED_INT(numberOfDaysOfTravel, 1, 250);
513 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
514 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(countries, 1, 250);
515 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedCarrierNum, 1, 32000);
516 FCB_READ_SEQUENCE_OF_IA5STRING(includedCarrierIA5);
517 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedCarrierNum, 1, 32000);
518 FCB_READ_SEQUENCE_OF_IA5STRING(excludedCarrierIA5);
519 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
520 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
521 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
522 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
523 FCB_READ_UNCONSTRAINED_INT(price);
524 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
525 FCB_READ_UTF8STRING(infoText);
526 FCB_READ_CUSTOM(extension);
529QDateTime Fcb::v13::PassData::validFrom(
const QDateTime &issueingDateTime)
const
531 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
534QDateTime Fcb::v13::PassData::validUntil(
const QDateTime &issueingDateTime)
const
536 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validUntilUTCOffsetValue());
539void Fcb::v13::VoucherData::decode(UPERDecoder &decoder)
541 decodeSequence(decoder);
542 FCB_READ_IA5STRING(referenceIA5);
543 FCB_READ_UNCONSTRAINED_INT(referenceNum);
544 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
545 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
550 FCB_READ_UNCONSTRAINED_INT(value);
551 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
552 FCB_READ_UTF8STRING(infoText);
553 FCB_READ_CUSTOM(extension);
556void Fcb::v13::CustomerCardData::decode(UPERDecoder &decoder)
558 decodeSequence(decoder);
559 FCB_READ_CUSTOM(customer);
560 FCB_READ_IA5STRING(cardIdIA5);
561 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
563 FCB_READ_CONSTRAINED_INT(validFromDay, 0, FCB_DATE_MAX);
564 FCB_READ_CONSTRAINED_INT(validUntilYear, 0, 250);
565 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
566 FCB_READ_ENUM(classCode);
567 FCB_READ_CONSTRAINED_INT(cardType, 1, 1000);
568 FCB_READ_UTF8STRING(cardTypeDescr);
569 FCB_READ_UNCONSTRAINED_INT(customerStatus);
570 FCB_READ_IA5STRING(customerStatusDescr);
571 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(includedServices);
572 FCB_READ_CUSTOM(extension);
575QDate Fcb::v13::CustomerCardData::validFrom()
const
580QDate Fcb::v13::CustomerCardData::validUntil()
const
582 return FcbUtil::decodeDifferentialDate(validFrom(), validUntilYear, validFromDayValue());
585void Fcb::v13::CountermarkData::decode(UPERDecoder &decoder)
587 decodeSequence(decoder);
588 FCB_READ_IA5STRING(referenceIA5);
589 FCB_READ_UNCONSTRAINED_INT(referenceNum);
590 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
591 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
592 FCB_READ_IA5STRING(ticketReferenceIA5);
593 FCB_READ_UNCONSTRAINED_INT(ticketReferenceNum);
597 FCB_READ_ENUM(stationCodeTable);
598 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
599 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
600 FCB_READ_UTF8STRING(fromStationNameUTF8);
601 FCB_READ_UTF8STRING(toStationNameUTF8);
602 FCB_READ_UTF8STRING(validRegionDesc);
603 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
605 FCB_READ_CUSTOM(returnDescription);
606 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
607 FCB_READ_TIME(validFromTime);
608 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
609 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
610 FCB_READ_TIME(validUntilTime);
611 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
612 FCB_READ_ENUM(classCode);
613 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
614 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
615 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
616 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
617 FCB_READ_UTF8STRING(infoText);
618 FCB_READ_CUSTOM(extension);
621void Fcb::v13::ParkingGroundData::decode(UPERDecoder &decoder)
623 decodeSequence(decoder);
624 FCB_READ_IA5STRING(referenceIA5);
625 FCB_READ_UNCONSTRAINED_INT(referenceNum);
628 FCB_READ_CONSTRAINED_INT(untilParkingDate, 0, FCB_DATE_MAX);
629 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
630 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
631 FCB_READ_IA5STRING(accessCode);
633 FCB_READ_ENUM(stationCodeTable);
634 FCB_READ_UNCONSTRAINED_INT(stationNum);
635 FCB_READ_UTF8STRING(stationIA5);
636 FCB_READ_UTF8STRING(specialInformation);
637 FCB_READ_UTF8STRING(entryTrack);
638 FCB_READ_IA5STRING(numberPlate);
639 FCB_READ_UNCONSTRAINED_INT(price);
640 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
641 FCB_READ_CUSTOM(extension);
644void Fcb::v13::FIPTicketData::decode(UPERDecoder &decoder)
646 decodeSequence(decoder);
647 FCB_READ_IA5STRING(referenceIA5);
648 FCB_READ_UNCONSTRAINED_INT(referenceNum);
649 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
650 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
651 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
652 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
653 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
654 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
655 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
658 FCB_READ_ENUM(classCode);
659 FCB_READ_CUSTOM(extension);
662void Fcb::v13::StationPassageData::decode(UPERDecoder &decoder)
664 decodeSequence(decoder);
665 FCB_READ_IA5STRING(referenceIA5);
666 FCB_READ_UNCONSTRAINED_INT(referenceNum);
667 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
668 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
669 FCB_READ_UTF8STRING(productName);
670 FCB_READ_ENUM(stationCodeTable);
671 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(stationNum);
672 FCB_READ_SEQUENCE_OF_IA5STRING(stationIA5);
673 FCB_READ_SEQUENCE_OF_UTF8STRING(stationNameUTF8);
674 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(areaCodeNum);
675 FCB_READ_SEQUENCE_OF_IA5STRING(areaCodeIA5);
676 FCB_READ_SEQUENCE_OF_UTF8STRING(areaNameUTF8);
678 FCB_READ_TIME(validFromTime);
679 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
680 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
681 FCB_READ_TIME(validUntilTime);
682 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
683 FCB_READ_UNCONSTRAINED_INT(numberOfDaysValid);
684 FCB_READ_CUSTOM(extension);
687void Fcb::v13::DelayConfirmation::decode(UPERDecoder &decoder)
689 decodeSequence(decoder);
690 FCB_READ_IA5STRING(referenceIA5);
691 FCB_READ_UNCONSTRAINED_INT(referenceNum);
692 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
693 FCB_READ_CONSTRAINED_INT(departureYear, 2016, 2269);
694 FCB_READ_CONSTRAINED_INT(departureDay, 1, 366);
695 FCB_READ_TIME(departureTime);
696 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
697 FCB_READ_ENUM(stationCodeTable);
698 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
701 FCB_READ_ENUM(confirmationType);
702 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
703 FCB_READ_UTF8STRING(infoText);
704 FCB_READ_CUSTOM(extension);
707void Fcb::v13::TokenType::decode(UPERDecoder &decoder)
709 decodeSequence(decoder);
710 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
711 FCB_READ_IA5STRING(tokenSpecification);
715void Fcb::v13::DocumentData::decode(UPERDecoder &decoder)
717 decodeSequence(decoder);
718 FCB_READ_CUSTOM(token);
735void Fcb::v13::TicketLinkType::decode(UPERDecoder &decoder)
737 decodeSequence(decoder);
738 FCB_READ_IA5STRING(referenceIA5);
739 FCB_READ_UNCONSTRAINED_INT(referenceNum);
740 FCB_READ_UTF8STRING(issuerName);
741 FCB_READ_IA5STRING(issuerPNR);
742 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
743 FCB_READ_ENUM(ticketType);
744 FCB_READ_ENUM(linkMode);
747void Fcb::v13::ControlData::decode(UPERDecoder &decoder)
749 decodeSequence(decoder);
750 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
752 identificationByPassportId = decoder.
readBoolean();
753 FCB_READ_UNCONSTRAINED_INT(identificationItem);
754 passportValidationRequired = decoder.
readBoolean();
756 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
758 reductionCardCheckRequired = decoder.
readBoolean();
759 FCB_READ_UTF8STRING(infoText);
760 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
761 FCB_READ_CUSTOM(extension);
764Fcb::v13::UicRailTicketData::UicRailTicketData() =
default;
766Fcb::v13::UicRailTicketData::UicRailTicketData(
const Uic9183Block &block)
775 qCWarning(Log) << decoder.errorMessage();
780void Fcb::v13::UicRailTicketData::decode(
UPERDecoder &decoder)
782 decodeSequence(decoder);
783 issuingDetail.decode(decoder);
784 FCB_READ_CUSTOM(travelerDetail);
785 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
786 FCB_READ_CUSTOM(controlDetail)
789bool Fcb::v13::UicRailTicketData::isValid()
const
791 return !m_block.isNull();
794#include "moc_fcbticket.cpp"
Non-owning bit-level view for working with data that isn't byte-aligned.
static QDateTime decodeDifferentialTime(const QDateTime &baseDt, int day, std::optional< int > time, std::optional< int > utcOffset)
Decode differential time, relative to baseDt.
static QDateTime issuingDateTime(int year, int day, std::optional< int > time)
Decode FCB issuing time.
static QDate decodeDate(int year, std::optional< int > day)
Decode FCB date.
Car carriage reservation document.
Delay confirmation document.
Delta encoding of a geographic coordinate.
Open ticket document (NRT).
Rail pass document (RPT).
Reservation document (IRT, RES).
Station passage document.
Reference to a specific train journey.
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.
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.
QStringView country(QStringView ifopt)