7#include "fcbreader_p.h"
11#include "asn1/uperdecoder.h"
13constexpr inline auto FCB_TIME_MAX = 1439;
14constexpr inline auto FCB_BEGIN_DATE_MIN = -367;
15constexpr inline auto FCB_END_DATE_MIN = -1;
16constexpr inline auto FCB_DATE_MAX = 500;
18constexpr inline auto FCB_PRODUCT_ID_NUM_MAX = 65535;
24 decodeSequence(decoder);
29void Fcb::v3::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::v3::DeltaCoordinate::decode(UPERDecoder &decoder)
43 decodeSequence(decoder);
48void Fcb::v3::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::v3::IssuingData::issueingDateTime()
const
74void Fcb::v3::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::v3::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(monthOfBirth, 1, 12);
96 FCB_READ_CONSTRAINED_INT(dayOfBirthInMonth, 1, 31);
98 FCB_READ_ENUM(passengerType);
99 if (passengerWithReducedMobilityIsSet()) {
100 passengerWithReducedMobility = decoder.
readBoolean();
102 FCB_READ_CONSTRAINED_INT(countryOfResidence, 1, 999);
103 FCB_READ_CONSTRAINED_INT(countryOfPassport, 1, 999);
104 FCB_READ_CONSTRAINED_INT(countryOfIdCard, 1, 999);
105 FCB_READ_SEQUENCE_OF_CUSTOM(
status);
108void Fcb::v3::TravelerData::decode(UPERDecoder &decoder)
110 decodeSequence(decoder);
111 FCB_READ_SEQUENCE_OF_CUSTOM(traveler);
112 FCB_READ_IA5STRING_CONSTRAINED(preferredLanguage, 2, 2);
113 FCB_READ_UTF8STRING(groupName);
116void Fcb::v3::TrainLinkType::decode(UPERDecoder &decoder)
118 decodeSequence(decoder);
119 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
121 FCB_READ_TIME(departureTime);
122 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
123 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
124 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
125 FCB_READ_UTF8STRING(fromStationNameUTF8);
126 FCB_READ_UTF8STRING(toStationNameUTF8);
129QDateTime Fcb::v3::TrainLinkType::departureDateTime(
const QDateTime &issueingDateTime)
const
134void Fcb::v3::ViaStationType::decode(UPERDecoder &decoder)
136 decodeSequence(decoder);
137 FCB_READ_ENUM(stationCodeTable);
138 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
139 FCB_READ_SEQUENCE_OF_CUSTOM(alternativeRoutes);
140 FCB_READ_SEQUENCE_OF_CUSTOM(route);
142 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
143 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
144 FCB_READ_UNCONSTRAINED_INT(seriesId);
145 FCB_READ_UNCONSTRAINED_INT(routeId);
146 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
147 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
150void Fcb::v3::ZoneType::decode(UPERDecoder &decoder)
152 decodeSequence(decoder);
153 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
154 FCB_READ_ENUM(stationCodeTable);
155 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
156 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
157 FCB_READ_UNCONSTRAINED_INT(city);
158 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(zoneId);
159 FCB_READ_OCTETSTRING(binaryZoneId);
160 FCB_READ_IA5STRING(nutsCode);
163void Fcb::v3::LineType::decode(UPERDecoder &decoder)
165 decodeSequence(decoder);
166 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
167 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(lineId);
168 FCB_READ_ENUM(stationCodeTable);
169 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
170 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
171 FCB_READ_CONSTRAINED_INT(city, 1, 9999999);
174void Fcb::v3::PolygoneType::decode(UPERDecoder &decoder)
176 decodeSequence(decoder);
177 firstEdge.decode(decoder);
181void Fcb::v3::RegionalValidityType::decode(UPERDecoder &decoder)
186void Fcb::v3::ReturnRouteDescriptionType::decode(UPERDecoder &decoder)
188 decodeSequence(decoder);
189 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
190 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
191 FCB_READ_UTF8STRING(fromStationNameUTF8);
192 FCB_READ_UTF8STRING(toStationNameUTF8);
193 FCB_READ_UTF8STRING(validReturnRegionDesc);
194 FCB_READ_SEQUENCE_OF_CUSTOM(validReturnRegion);
197void Fcb::v3::RouteSectionType::decode(UPERDecoder &decoder)
199 decodeSequence(decoder);
200 FCB_READ_ENUM(stationCodeTable);
201 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
202 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
203 FCB_READ_UTF8STRING(fromStationNameUTF8);
204 FCB_READ_UTF8STRING(toStationNameUTF8);
207void Fcb::v3::SeriesDetailType::decode(UPERDecoder &decoder)
209 decodeSequence(decoder);
210 FCB_READ_CONSTRAINED_INT(supplyingCarrier, 1, 32000);
211 FCB_READ_CONSTRAINED_INT(offerIdentification, 1, 99);
212 FCB_READ_UNCONSTRAINED_INT(series);
215void Fcb::v3::CardReferenceType::decode(UPERDecoder &decoder)
217 decodeSequence(decoder);
218 FCB_READ_INT_IA5_PAIR(cardIssuer, 1, 32000);
219 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(cardId);
220 FCB_READ_UTF8STRING(cardName);
221 FCB_READ_UNCONSTRAINED_INT(cardType);
222 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(leadingCardId);
223 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(trailingCardId);
226void Fcb::v3::PlacesType::decode(KItinerary::UPERDecoder &decoder)
228 decodeSequence(decoder);
229 FCB_READ_IA5STRING(coach);
230 FCB_READ_IA5STRING(placeString);
231 FCB_READ_UTF8STRING(placeDescription);
232 FCB_READ_SEQUENCE_OF_IA5STRING(placeIA5);
233 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(placeNum, 1, 254);
236void Fcb::v3::CompartmentDetailsType::decode(UPERDecoder &decoder)
238 decodeSequence(decoder);
239 FCB_READ_CONSTRAINED_INT(coachType, 1, 99);
240 FCB_READ_CONSTRAINED_INT(compartmentType, 1, 99);
241 FCB_READ_CONSTRAINED_INT(specialAllocation, 1, 99);
242 FCB_READ_UTF8STRING(coachTypeDescr);
243 FCB_READ_UTF8STRING(compartmentTypeDescr);
244 FCB_READ_UTF8STRING(specialAllocationDescr);
245 FCB_READ_ENUM(position);
248void Fcb::v3::BerthDetailData::decode(UPERDecoder &decoder)
250 decodeSequence(decoder);
253 FCB_READ_ENUM(gender);
256void Fcb::v3::TariffType::decode(UPERDecoder &decoder)
258 decodeSequence(decoder);
259 FCB_READ_CONSTRAINED_INT(numberOfPassengers, 1, 200);
260 FCB_READ_ENUM(passengerType);
261 FCB_READ_CONSTRAINED_INT(ageBelow, 1, 64);
262 FCB_READ_CONSTRAINED_INT(ageAbove, 1, 128);
263 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(travelerid, 1, 254);
264 restrictedToCountryOfResidence = decoder.
readBoolean();
265 FCB_READ_CUSTOM(restrictedToRouteSection);
266 FCB_READ_CUSTOM(seriesDataDetails);
267 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tariffId);
268 FCB_READ_UTF8STRING(tariffDesc);
269 FCB_READ_SEQUENCE_OF_CUSTOM(reductionCard);
272void Fcb::v3::VatDetailType::decode(UPERDecoder &decoder)
274 decodeSequence(decoder);
277 FCB_READ_UNCONSTRAINED_INT(amount);
278 FCB_READ_IA5STRING(vatId);
281void Fcb::v3::IncludedOpenTicketType::decode(UPERDecoder &decoder)
283 decodeSequence(decoder);
284 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
285 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
286 FCB_READ_UNCONSTRAINED_INT(externalIssuerId);
287 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
288 FCB_READ_ENUM(stationCodeTable);
289 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
290 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
291 FCB_READ_TIME(validFromTime);
292 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
293 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
294 FCB_READ_TIME(validUntilTime);
295 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
296 FCB_READ_ENUM(classCode);
297 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
298 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
299 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
300 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
301 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
302 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
303 FCB_READ_UTF8STRING(infoText);
304 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedTransportType, 0, 31);
305 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedTransportType, 0, 31);
306 FCB_READ_CUSTOM(extension);
309void Fcb::v3::RegisteredLuggageType::decode(UPERDecoder &decoder)
311 decodeSequence(decoder);
312 FCB_READ_IA5STRING(registrationId);
313 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
314 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
317void Fcb::v3::LuggageRestrictionType::decode(UPERDecoder &decoder)
319 decodeSequence(decoder);
320 FCB_READ_CONSTRAINED_INT(maxHandLuggagePieces, 0, 99);
321 FCB_READ_CONSTRAINED_INT(maxNonHandLuggagePieces, 0, 99);
322 FCB_READ_SEQUENCE_OF_CUSTOM(registeredLuggage);
325void Fcb::v3::ReservationData::decode(UPERDecoder &decoder)
327 decodeSequence(decoder);
328 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
329 FCB_READ_CONSTRAINED_INT(departureDate, -1, FCB_DATE_MAX);
330 FCB_READ_IA5STRING(referenceIA5);
331 FCB_READ_UNCONSTRAINED_INT(referenceNum);
332 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
333 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
334 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
335 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
336 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
337 FCB_READ_ENUM(service);
338 FCB_READ_ENUM(stationCodeTable);
339 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
340 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
341 FCB_READ_UTF8STRING(fromStationNameUTF8);
342 FCB_READ_UTF8STRING(toStationNameUTF8);
343 FCB_READ_TIME(departureTime);
344 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
345 FCB_READ_CONSTRAINED_INT(arrivalDate, FCB_END_DATE_MIN, 20);
346 FCB_READ_TIME(arrivalTime);
347 FCB_READ_CONSTRAINED_INT(arrivalUTCOffset, -60, 60);
348 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
349 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
350 FCB_READ_ENUM(classCode);
351 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
352 FCB_READ_CUSTOM(places);
353 FCB_READ_CUSTOM(additionalPlaces);
354 FCB_READ_CUSTOM(bicyclePlaces);
355 FCB_READ_CUSTOM(compartmentDetails);
356 FCB_READ_CONSTRAINED_INT(numberOfOverbooked, 0, 200);
357 FCB_READ_SEQUENCE_OF_CUSTOM(berth);
358 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
359 FCB_READ_ENUM(priceType);
360 FCB_READ_UNCONSTRAINED_INT(price);
361 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
362 FCB_READ_CONSTRAINED_INT(typeOfSupplement, 0, 9);
363 FCB_READ_CONSTRAINED_INT(numberOfSupplements, 0, 200);
364 FCB_READ_CUSTOM(luggage);
365 FCB_READ_UTF8STRING(infoText);
366 FCB_READ_CUSTOM(extension);
369QDateTime Fcb::v3::ReservationData::departureDateTime(
const QDateTime &issueingDateTime)
const
374QDateTime Fcb::v3::ReservationData::arrivalDateTime(
const QDateTime &issueingDateTime)
const
379void Fcb::v3::CarCarriageReservationData::decode(UPERDecoder &decoder)
381 decodeSequence(decoder);
382 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
383 FCB_READ_CONSTRAINED_INT(beginLoadingDate, -1, FCB_DATE_MAX);
384 FCB_READ_TIME(beginLoadingTime);
385 FCB_READ_TIME(endLoadingTime);
386 FCB_READ_CONSTRAINED_INT(loadingUTCOffset, -60, 60);
387 FCB_READ_IA5STRING(referenceIA5);
388 FCB_READ_UNCONSTRAINED_INT(referenceNum);
389 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
390 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
391 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
392 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
393 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
394 FCB_READ_ENUM(stationCodeTable);
395 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
396 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
397 FCB_READ_UTF8STRING(fromStationNameUTF8);
398 FCB_READ_UTF8STRING(toStationNameUTF8);
399 FCB_READ_IA5STRING(coach);
400 FCB_READ_IA5STRING(place);
401 FCB_READ_CUSTOM(compartmentDetails);
402 FCB_READ_IA5STRING(numberPlate);
403 FCB_READ_IA5STRING(trailerPlate);
405 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
407 FCB_READ_ENUM(roofRackType);
408 FCB_READ_CONSTRAINED_INT(roofRackHeight, 0, 99);
409 FCB_READ_CONSTRAINED_INT(attachedBoats, 0, 2);
410 FCB_READ_CONSTRAINED_INT(attachedBicycles, 0, 4);
411 FCB_READ_CONSTRAINED_INT(attachedSurfboards, 0, 5);
412 FCB_READ_CONSTRAINED_INT(loadingListEntry, 0, 999);
413 FCB_READ_ENUM(loadingDeck);
414 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
415 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
416 tariff.decode(decoder);
417 FCB_READ_ENUM(priceType);
418 FCB_READ_UNCONSTRAINED_INT(price);
419 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
420 FCB_READ_UTF8STRING(infoText);
421 FCB_READ_CUSTOM(extension);
424void Fcb::v3::OpenTicketData::decode(UPERDecoder &decoder)
426 decodeSequence(decoder);
427 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
428 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
429 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
430 FCB_READ_UNCONSTRAINED_INT(extIssuerId);
431 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
433 FCB_READ_ENUM(stationCodeTable);
434 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
435 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
436 FCB_READ_UTF8STRING(fromStationNameUTF8);
437 FCB_READ_UTF8STRING(toStationNameUTF8);
438 FCB_READ_UTF8STRING(validRegionDesc);
439 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
440 FCB_READ_CUSTOM(returnDescription);
441 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
442 FCB_READ_TIME(validFromTime);
443 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
444 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
445 FCB_READ_TIME(validUntilTime);
446 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
447 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
448 FCB_READ_ENUM(classCode);
449 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
450 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
451 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
452 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
453 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
454 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
455 FCB_READ_UNCONSTRAINED_INT(price);
456 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
457 FCB_READ_UTF8STRING(infoText);
458 FCB_READ_SEQUENCE_OF_CUSTOM(includedAddOns);
459 FCB_READ_CUSTOM(luggage);
460 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedTransportType, 0, 31);
461 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedTransportType, 0, 31);
462 FCB_READ_CUSTOM(extension);
465QDateTime Fcb::v3::OpenTicketData::validFrom(
const QDateTime &issueingDateTime)
const
467 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
470QDateTime Fcb::v3::OpenTicketData::validUntil(
const QDateTime &issueingDateTime)
const
472 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validFromUTCOffsetValue());
475void Fcb::v3::TimeRangeType::decode(UPERDecoder &decoder)
477 decodeSequence(decoder);
478 FCB_READ_TIME(fromTime);
479 FCB_READ_TIME(untilTime);
482void Fcb::v3::ValidityPeriodType::decode(UPERDecoder &decoder)
484 decodeSequence(decoder);
485 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
486 FCB_READ_TIME(validFromTime);
487 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
488 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
489 FCB_READ_TIME(validUntilTime);
490 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
493void Fcb::v3::ValidityPeriodDetailType::decode(UPERDecoder &decoder)
495 decodeSequence(decoder);
496 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
497 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
500void Fcb::v3::TrainValidityType::decode(UPERDecoder &decoder)
502 decodeSequence(decoder);
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_SEQUENCE_OF_CONTRAINED_INT(includedCarrierNum, 1, 32000);
510 FCB_READ_SEQUENCE_OF_IA5STRING(includedCarrierIA5);
511 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedCarrierNum, 1, 32000);
512 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
513 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
514 FCB_READ_ENUM(boardingOrArrival);
517void Fcb::v3::PassData::decode(UPERDecoder &decoder)
519 decodeSequence(decoder);
520 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
521 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
522 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
523 FCB_READ_CONSTRAINED_INT(passType, 1, 250);
524 FCB_READ_UTF8STRING(passDescription);
525 FCB_READ_ENUM(classCode);
526 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
527 FCB_READ_TIME(validFromTime);
528 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
529 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
530 FCB_READ_TIME(validUntilTime);
531 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
532 FCB_READ_CUSTOM(validityPeriodDetails);
533 FCB_READ_CONSTRAINED_INT(numberOfValidityDays, 0, FCB_DATE_MAX);
534 FCB_READ_CONSTRAINED_INT(numberOfPossibleTrips, 1, 250);
535 FCB_READ_CONSTRAINED_INT(numberOfDaysOfTravel, 1, 250);
536 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
537 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(countries, 1, 250);
538 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedCarrierNum, 1, 32000);
539 FCB_READ_SEQUENCE_OF_IA5STRING(includedCarrierIA5);
540 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedCarrierNum, 1, 32000);
541 FCB_READ_SEQUENCE_OF_IA5STRING(excludedCarrierIA5);
542 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
543 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
544 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
545 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
546 FCB_READ_UNCONSTRAINED_INT(price);
547 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
548 FCB_READ_UTF8STRING(infoText);
549 FCB_READ_CUSTOM(extension);
552QDateTime Fcb::v3::PassData::validFrom(
const QDateTime &issueingDateTime)
const
554 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
557QDateTime Fcb::v3::PassData::validUntil(
const QDateTime &issueingDateTime)
const
559 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validUntilUTCOffsetValue());
562void Fcb::v3::VoucherData::decode(UPERDecoder &decoder)
564 decodeSequence(decoder);
565 FCB_READ_IA5STRING(referenceIA5);
566 FCB_READ_UNCONSTRAINED_INT(referenceNum);
567 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
568 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
573 FCB_READ_UNCONSTRAINED_INT(value);
574 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
575 FCB_READ_UTF8STRING(infoText);
576 FCB_READ_CUSTOM(extension);
579void Fcb::v3::CustomerCardData::decode(UPERDecoder &decoder)
581 decodeSequence(decoder);
582 FCB_READ_CUSTOM(customer);
583 FCB_READ_IA5STRING(cardIdIA5);
584 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
586 FCB_READ_CONSTRAINED_INT(validFromDay, 0, FCB_DATE_MAX);
587 FCB_READ_CONSTRAINED_INT(validUntilYear, 0, 250);
588 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
589 FCB_READ_ENUM(classCode);
590 FCB_READ_CONSTRAINED_INT(cardType, 1, 1000);
591 FCB_READ_UTF8STRING(cardTypeDescr);
592 FCB_READ_UNCONSTRAINED_INT(customerStatus);
593 FCB_READ_IA5STRING(customerStatusDescr);
594 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(includedServices);
595 FCB_READ_CUSTOM(extension);
598QDate Fcb::v3::CustomerCardData::validFrom()
const
603QDate Fcb::v3::CustomerCardData::validUntil()
const
605 return FcbUtil::decodeDifferentialDate(validFrom(), validUntilYear, validFromDayValue());
608void Fcb::v3::CountermarkData::decode(UPERDecoder &decoder)
610 decodeSequence(decoder);
611 FCB_READ_IA5STRING(referenceIA5);
612 FCB_READ_UNCONSTRAINED_INT(referenceNum);
613 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
614 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
615 FCB_READ_IA5STRING(ticketReferenceIA5);
616 FCB_READ_UNCONSTRAINED_INT(ticketReferenceNum);
620 FCB_READ_ENUM(stationCodeTable);
621 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
622 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
623 FCB_READ_UTF8STRING(fromStationNameUTF8);
624 FCB_READ_UTF8STRING(toStationNameUTF8);
625 FCB_READ_UTF8STRING(validRegionDesc);
626 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
628 FCB_READ_CUSTOM(returnDescription);
629 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
630 FCB_READ_TIME(validFromTime);
631 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
632 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
633 FCB_READ_TIME(validUntilTime);
634 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
635 FCB_READ_ENUM(classCode);
636 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
637 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
638 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
639 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
640 FCB_READ_UTF8STRING(infoText);
641 FCB_READ_CUSTOM(extension);
644void Fcb::v3::ParkingGroundData::decode(UPERDecoder &decoder)
646 decodeSequence(decoder);
647 FCB_READ_IA5STRING(referenceIA5);
648 FCB_READ_UNCONSTRAINED_INT(referenceNum);
651 FCB_READ_CONSTRAINED_INT(untilParkingDate, 0, FCB_DATE_MAX);
652 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
653 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
654 FCB_READ_IA5STRING(accessCode);
656 FCB_READ_ENUM(stationCodeTable);
657 FCB_READ_UNCONSTRAINED_INT(stationNum);
658 FCB_READ_UTF8STRING(stationIA5);
659 FCB_READ_UTF8STRING(specialInformation);
660 FCB_READ_UTF8STRING(entryTrack);
661 FCB_READ_IA5STRING(numberPlate);
662 FCB_READ_UNCONSTRAINED_INT(price);
663 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
664 FCB_READ_CUSTOM(extension);
667void Fcb::v3::FIPTicketData::decode(UPERDecoder &decoder)
669 decodeSequence(decoder);
670 FCB_READ_IA5STRING(referenceIA5);
671 FCB_READ_UNCONSTRAINED_INT(referenceNum);
672 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
673 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
674 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
675 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
676 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
677 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
678 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
681 FCB_READ_ENUM(classCode);
682 FCB_READ_CUSTOM(extension);
685void Fcb::v3::StationPassageData::decode(UPERDecoder &decoder)
687 decodeSequence(decoder);
688 FCB_READ_IA5STRING(referenceIA5);
689 FCB_READ_UNCONSTRAINED_INT(referenceNum);
690 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
691 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
692 FCB_READ_UTF8STRING(productName);
693 FCB_READ_ENUM(stationCodeTable);
694 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(stationNum);
695 FCB_READ_SEQUENCE_OF_IA5STRING(stationIA5);
696 FCB_READ_SEQUENCE_OF_UTF8STRING(stationNameUTF8);
697 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(areaCodeNum);
698 FCB_READ_SEQUENCE_OF_IA5STRING(areaCodeIA5);
699 FCB_READ_SEQUENCE_OF_UTF8STRING(areaNameUTF8);
701 FCB_READ_TIME(validFromTime);
702 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
703 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
704 FCB_READ_TIME(validUntilTime);
705 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
706 FCB_READ_UNCONSTRAINED_INT(numberOfDaysValid);
707 FCB_READ_CUSTOM(extension);
710void Fcb::v3::DelayConfirmation::decode(UPERDecoder &decoder)
712 decodeSequence(decoder);
713 FCB_READ_IA5STRING(referenceIA5);
714 FCB_READ_UNCONSTRAINED_INT(referenceNum);
715 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
716 FCB_READ_CONSTRAINED_INT(departureYear, 2016, 2269);
717 FCB_READ_CONSTRAINED_INT(departureDay, 1, 366);
718 FCB_READ_TIME(departureTime);
719 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
720 FCB_READ_ENUM(stationCodeTable);
721 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
724 FCB_READ_ENUM(confirmationType);
725 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
726 FCB_READ_UTF8STRING(infoText);
727 FCB_READ_CUSTOM(extension);
730void Fcb::v3::TokenType::decode(UPERDecoder &decoder)
732 decodeSequence(decoder);
733 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
734 FCB_READ_IA5STRING(tokenSpecification);
738void Fcb::v3::DocumentData::decode(UPERDecoder &decoder)
740 decodeSequence(decoder);
741 FCB_READ_CUSTOM(token);
758void Fcb::v3::TicketLinkType::decode(UPERDecoder &decoder)
760 decodeSequence(decoder);
761 FCB_READ_IA5STRING(referenceIA5);
762 FCB_READ_UNCONSTRAINED_INT(referenceNum);
763 FCB_READ_UTF8STRING(issuerName);
764 FCB_READ_IA5STRING(issuerPNR);
765 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
766 FCB_READ_ENUM(ticketType);
767 FCB_READ_ENUM(linkMode);
770void Fcb::v3::ControlData::decode(UPERDecoder &decoder)
772 decodeSequence(decoder);
773 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
775 identificationByPassportId = decoder.
readBoolean();
776 FCB_READ_UNCONSTRAINED_INT(identificationItem);
777 passportValidationRequired = decoder.
readBoolean();
779 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
781 reductionCardCheckRequired = decoder.
readBoolean();
782 FCB_READ_UTF8STRING(infoText);
783 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
784 FCB_READ_CUSTOM(extension);
787Fcb::v3::UicRailTicketData::UicRailTicketData() =
default;
789Fcb::v3::UicRailTicketData::UicRailTicketData(
const Uic9183Block &block)
798 qCWarning(Log) << decoder.errorMessage();
803void Fcb::v3::UicRailTicketData::decode(
UPERDecoder &decoder)
805 decodeSequence(decoder);
806 issuingDetail.decode(decoder);
807 FCB_READ_CUSTOM(travelerDetail);
808 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
809 FCB_READ_CUSTOM(controlDetail)
812bool Fcb::v3::UicRailTicketData::isValid()
const
814 return !m_block.isNull();
817#include "moc_fcbticket3.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)