7#include "fcbreader_p.h"
11#include "asn1/uperdecoder.h"
13constexpr inline auto FCB_TIME_MAX = 1439;
14constexpr inline auto FCB_BEGIN_DATE_MIN = -1;
15constexpr inline auto FCB_END_DATE_MIN = -1;
16constexpr inline auto FCB_DATE_MAX = 370;
18constexpr inline auto FCB_PRODUCT_ID_NUM_MAX = 65535;
24 decodeSequence(decoder);
29void Fcb::v2::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::v2::DeltaCoordinate::decode(UPERDecoder &decoder)
43 decodeSequence(decoder);
48void Fcb::v2::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::v2::IssuingData::issueingDateTime()
const
74void Fcb::v2::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::v2::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::v2::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::v2::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::v2::TrainLinkType::departureDateTime(
const QDateTime &issueingDateTime)
const
134void Fcb::v2::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);
148void Fcb::v2::ZoneType::decode(UPERDecoder &decoder)
150 decodeSequence(decoder);
151 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
152 FCB_READ_ENUM(stationCodeTable);
153 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
154 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
155 FCB_READ_UNCONSTRAINED_INT(city);
156 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(zoneId);
157 FCB_READ_OCTETSTRING(binaryZoneId);
158 FCB_READ_IA5STRING(nutsCode);
161void Fcb::v2::LineType::decode(UPERDecoder &decoder)
163 decodeSequence(decoder);
164 FCB_READ_INT_IA5_PAIR(carrier, 1, 32000);
165 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(lineId);
166 FCB_READ_ENUM(stationCodeTable);
167 FCB_READ_INT_IA5_PAIR(entryStation, 1, 9999999);
168 FCB_READ_INT_IA5_PAIR(terminatingStation, 1, 9999999);
169 FCB_READ_CONSTRAINED_INT(city, 1, 9999999);
172void Fcb::v2::PolygoneType::decode(UPERDecoder &decoder)
174 decodeSequence(decoder);
175 firstEdge.decode(decoder);
179void Fcb::v2::RegionalValidityType::decode(UPERDecoder &decoder)
184void Fcb::v2::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::v2::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::v2::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::v2::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::v2::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::v2::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::v2::BerthDetailData::decode(UPERDecoder &decoder)
248 decodeSequence(decoder);
251 FCB_READ_ENUM(gender);
254void Fcb::v2::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, 1, 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::v2::VatDetailType::decode(UPERDecoder &decoder)
272 decodeSequence(decoder);
275 FCB_READ_UNCONSTRAINED_INT(amount);
276 FCB_READ_IA5STRING(vatId);
279void Fcb::v2::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_SEQUENCE_OF_CONTRAINED_INT(includedTransportType, 0, 31);
303 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedTransportType, 0, 31);
304 FCB_READ_CUSTOM(extension);
307void Fcb::v2::RegisteredLuggageType::decode(UPERDecoder &decoder)
309 decodeSequence(decoder);
310 FCB_READ_IA5STRING(registrationId);
311 FCB_READ_CONSTRAINED_INT(maxWeight, 1, 99);
312 FCB_READ_CONSTRAINED_INT(maxSize, 1, 300);
315void Fcb::v2::LuggageRestrictionType::decode(UPERDecoder &decoder)
317 decodeSequence(decoder);
318 FCB_READ_CONSTRAINED_INT(maxHandLuggagePieces, 0, 99);
319 FCB_READ_CONSTRAINED_INT(maxNonHandLuggagePieces, 0, 99);
320 FCB_READ_SEQUENCE_OF_CUSTOM(registeredLuggage);
323void Fcb::v2::ReservationData::decode(UPERDecoder &decoder)
325 decodeSequence(decoder);
326 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
327 FCB_READ_CONSTRAINED_INT(departureDate, -1, FCB_DATE_MAX);
328 FCB_READ_IA5STRING(referenceIA5);
329 FCB_READ_UNCONSTRAINED_INT(referenceNum);
330 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
331 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
332 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
333 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
334 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
335 FCB_READ_ENUM(service);
336 FCB_READ_ENUM(stationCodeTable);
337 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
338 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
339 FCB_READ_UTF8STRING(fromStationNameUTF8);
340 FCB_READ_UTF8STRING(toStationNameUTF8);
341 FCB_READ_TIME(departureTime);
342 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
343 FCB_READ_CONSTRAINED_INT(arrivalDate, FCB_END_DATE_MIN, 20);
344 FCB_READ_TIME(arrivalTime);
345 FCB_READ_CONSTRAINED_INT(arrivalUTCOffset, -60, 60);
346 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
347 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
348 FCB_READ_ENUM(classCode);
349 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
350 FCB_READ_CUSTOM(places);
351 FCB_READ_CUSTOM(additionalPlaces);
352 FCB_READ_CUSTOM(bicyclePlaces);
353 FCB_READ_CUSTOM(compartmentDetails);
354 FCB_READ_CONSTRAINED_INT(numberOfOverbooked, 0, 200);
355 FCB_READ_SEQUENCE_OF_CUSTOM(berth);
356 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
357 FCB_READ_ENUM(priceType);
358 FCB_READ_UNCONSTRAINED_INT(price);
359 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
360 FCB_READ_CONSTRAINED_INT(typeOfSupplement, 0, 9);
361 FCB_READ_CONSTRAINED_INT(numberOfSupplements, 0, 200);
362 FCB_READ_CUSTOM(luggage);
363 FCB_READ_UTF8STRING(infoText);
364 FCB_READ_CUSTOM(extension);
367QDateTime Fcb::v2::ReservationData::departureDateTime(
const QDateTime &issueingDateTime)
const
372QDateTime Fcb::v2::ReservationData::arrivalDateTime(
const QDateTime &issueingDateTime)
const
377void Fcb::v2::CarCarriageReservationData::decode(UPERDecoder &decoder)
379 decodeSequence(decoder);
380 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
381 FCB_READ_CONSTRAINED_INT(beginLoadingDate, -1, FCB_DATE_MAX);
382 FCB_READ_TIME(beginLoadingTime);
383 FCB_READ_TIME(endLoadingTime);
384 FCB_READ_CONSTRAINED_INT(loadingUTCOffset, -60, 60);
385 FCB_READ_IA5STRING(referenceIA5);
386 FCB_READ_UNCONSTRAINED_INT(referenceNum);
387 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
388 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
389 FCB_READ_CONSTRAINED_INT(serviceBrand, 0, 32000);
390 FCB_READ_UTF8STRING(serviceBrandAbrUTF8);
391 FCB_READ_UTF8STRING(serviceBrandNameUTF8);
392 FCB_READ_ENUM(stationCodeTable);
393 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
394 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
395 FCB_READ_UTF8STRING(fromStationNameUTF8);
396 FCB_READ_UTF8STRING(toStationNameUTF8);
397 FCB_READ_IA5STRING(coach);
398 FCB_READ_IA5STRING(place);
399 FCB_READ_CUSTOM(compartmentDetails);
400 FCB_READ_IA5STRING(numberPlate);
401 FCB_READ_IA5STRING(trailerPlate);
403 FCB_READ_CONSTRAINED_INT(boatCategory, 0, 9);
405 FCB_READ_ENUM(roofRackType);
406 FCB_READ_CONSTRAINED_INT(roofRackHeight, 0, 99);
407 FCB_READ_CONSTRAINED_INT(attachedBoats, 0, 2);
408 FCB_READ_CONSTRAINED_INT(attachedBicycles, 0, 4);
409 FCB_READ_CONSTRAINED_INT(attachedSurfboards, 0, 5);
410 FCB_READ_CONSTRAINED_INT(loadingListEntry, 0, 999);
411 FCB_READ_ENUM(loadingDeck);
412 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
413 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
414 tariff.decode(decoder);
415 FCB_READ_ENUM(priceType);
416 FCB_READ_UNCONSTRAINED_INT(price);
417 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
418 FCB_READ_UTF8STRING(infoText);
419 FCB_READ_CUSTOM(extension);
422void Fcb::v2::OpenTicketData::decode(UPERDecoder &decoder)
424 decodeSequence(decoder);
425 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
426 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
427 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
428 FCB_READ_UNCONSTRAINED_INT(extIssuerId);
429 FCB_READ_UNCONSTRAINED_INT(issuerAutorizationId);
431 FCB_READ_ENUM(stationCodeTable);
432 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
433 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
434 FCB_READ_UTF8STRING(fromStationNameUTF8);
435 FCB_READ_UTF8STRING(toStationNameUTF8);
436 FCB_READ_UTF8STRING(validRegionDesc);
437 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
438 FCB_READ_CUSTOM(returnDescription);
439 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
440 FCB_READ_TIME(validFromTime);
441 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
442 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
443 FCB_READ_TIME(validUntilTime);
444 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
445 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
446 FCB_READ_ENUM(classCode);
447 FCB_READ_IA5STRING_CONSTRAINED(serviceLevel, 1, 2);
448 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
449 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
450 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
451 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
452 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
453 FCB_READ_UNCONSTRAINED_INT(price);
454 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
455 FCB_READ_UTF8STRING(infoText);
456 FCB_READ_SEQUENCE_OF_CUSTOM(includedAddOns);
457 FCB_READ_CUSTOM(luggage);
458 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedTransportType, 0, 31);
459 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedTransportType, 0, 31);
460 FCB_READ_CUSTOM(extension);
463QDateTime Fcb::v2::OpenTicketData::validFrom(
const QDateTime &issueingDateTime)
const
465 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
468QDateTime Fcb::v2::OpenTicketData::validUntil(
const QDateTime &issueingDateTime)
const
470 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validFromUTCOffsetValue());
473void Fcb::v2::TimeRangeType::decode(UPERDecoder &decoder)
475 decodeSequence(decoder);
476 FCB_READ_TIME(fromTime);
477 FCB_READ_TIME(untilTime);
480void Fcb::v2::ValidityPeriodType::decode(UPERDecoder &decoder)
482 decodeSequence(decoder);
483 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
484 FCB_READ_TIME(validFromTime);
485 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
486 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
487 FCB_READ_TIME(validUntilTime);
488 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
491void Fcb::v2::ValidityPeriodDetailType::decode(UPERDecoder &decoder)
493 decodeSequence(decoder);
494 FCB_READ_SEQUENCE_OF_CUSTOM(validityPeriod);
495 FCB_READ_SEQUENCE_OF_CUSTOM(excludedTimeRange);
498void Fcb::v2::PassData::decode(UPERDecoder &decoder)
500 decodeSequence(decoder);
501 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(reference);
502 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
503 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
504 FCB_READ_CONSTRAINED_INT(passType, 1, 250);
505 FCB_READ_UTF8STRING(passDescription);
506 FCB_READ_ENUM(classCode);
507 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
508 FCB_READ_TIME(validFromTime);
509 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
510 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
511 FCB_READ_TIME(validUntilTime);
512 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
513 FCB_READ_CUSTOM(validityPeriodDetails);
514 FCB_READ_CONSTRAINED_INT(numberOfValidityDays, 0, FCB_DATE_MAX);
515 FCB_READ_CONSTRAINED_INT(numberOfPossibleTrips, 1, 250);
516 FCB_READ_CONSTRAINED_INT(numberOfDaysOfTravel, 1, 250);
517 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
518 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(countries, 1, 250);
519 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedCarrierNum, 1, 32000);
520 FCB_READ_SEQUENCE_OF_IA5STRING(includedCarrierIA5);
521 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedCarrierNum, 1, 32000);
522 FCB_READ_SEQUENCE_OF_IA5STRING(excludedCarrierIA5);
523 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
524 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
525 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
526 FCB_READ_SEQUENCE_OF_CUSTOM(tariffs);
527 FCB_READ_UNCONSTRAINED_INT(price);
528 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
529 FCB_READ_UTF8STRING(infoText);
530 FCB_READ_CUSTOM(extension);
533QDateTime Fcb::v2::PassData::validFrom(
const QDateTime &issueingDateTime)
const
535 return FcbUtil::decodeDifferentialStartTime(issueingDateTime, validFromDay, validFromTimeValue(), validFromUTCOffsetValue());
538QDateTime Fcb::v2::PassData::validUntil(
const QDateTime &issueingDateTime)
const
540 return FcbUtil::decodeDifferentialEndTime(validFrom(issueingDateTime), validUntilDay, validUntilTimeValue(), validUntilUTCOffsetValue());
543void Fcb::v2::VoucherData::decode(UPERDecoder &decoder)
545 decodeSequence(decoder);
546 FCB_READ_IA5STRING(referenceIA5);
547 FCB_READ_UNCONSTRAINED_INT(referenceNum);
548 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
549 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
554 FCB_READ_UNCONSTRAINED_INT(value);
555 FCB_READ_CONSTRAINED_INT(type, 1, 32000);
556 FCB_READ_UTF8STRING(infoText);
557 FCB_READ_CUSTOM(extension);
560void Fcb::v2::CustomerCardData::decode(UPERDecoder &decoder)
562 decodeSequence(decoder);
563 FCB_READ_CUSTOM(customer);
564 FCB_READ_IA5STRING(cardIdIA5);
565 FCB_READ_UNCONSTRAINED_INT(cardIdNum);
567 FCB_READ_CONSTRAINED_INT(validFromDay, 0, FCB_DATE_MAX);
568 FCB_READ_CONSTRAINED_INT(validUntilYear, 0, 250);
569 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
570 FCB_READ_ENUM(classCode);
571 FCB_READ_CONSTRAINED_INT(cardType, 1, 1000);
572 FCB_READ_UTF8STRING(cardTypeDescr);
573 FCB_READ_UNCONSTRAINED_INT(customerStatus);
574 FCB_READ_IA5STRING(customerStatusDescr);
575 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(includedServices);
576 FCB_READ_CUSTOM(extension);
579QDate Fcb::v2::CustomerCardData::validFrom()
const
584QDate Fcb::v2::CustomerCardData::validUntil()
const
586 return FcbUtil::decodeDifferentialDate(validFrom(), validUntilYear, validFromDayValue());
589void Fcb::v2::CountermarkData::decode(UPERDecoder &decoder)
591 decodeSequence(decoder);
592 FCB_READ_IA5STRING(referenceIA5);
593 FCB_READ_UNCONSTRAINED_INT(referenceNum);
594 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
595 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
596 FCB_READ_IA5STRING(ticketReferenceIA5);
597 FCB_READ_UNCONSTRAINED_INT(ticketReferenceNum);
601 FCB_READ_ENUM(stationCodeTable);
602 FCB_READ_INT_IA5_PAIR(fromStation, 1, 9999999);
603 FCB_READ_INT_IA5_PAIR(toStation, 1, 9999999);
604 FCB_READ_UTF8STRING(fromStationNameUTF8);
605 FCB_READ_UTF8STRING(toStationNameUTF8);
606 FCB_READ_UTF8STRING(validRegionDesc);
607 FCB_READ_SEQUENCE_OF_CUSTOM(validRegion);
609 FCB_READ_CUSTOM(returnDescription);
610 FCB_READ_CONSTRAINED_INT(validFromDay, FCB_BEGIN_DATE_MIN, 700);
611 FCB_READ_TIME(validFromTime);
612 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
613 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
614 FCB_READ_TIME(validUntilTime);
615 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
616 FCB_READ_ENUM(classCode);
617 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
618 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
619 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(includedServiceBrands, 1, 32000);
620 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(excludedServiceBrands, 1, 32000);
621 FCB_READ_UTF8STRING(infoText);
622 FCB_READ_CUSTOM(extension);
625void Fcb::v2::ParkingGroundData::decode(UPERDecoder &decoder)
627 decodeSequence(decoder);
628 FCB_READ_IA5STRING(referenceIA5);
629 FCB_READ_UNCONSTRAINED_INT(referenceNum);
632 FCB_READ_CONSTRAINED_INT(untilParkingDate, 0, FCB_DATE_MAX);
633 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
634 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
635 FCB_READ_IA5STRING(accessCode);
637 FCB_READ_ENUM(stationCodeTable);
638 FCB_READ_UNCONSTRAINED_INT(stationNum);
639 FCB_READ_UTF8STRING(stationIA5);
640 FCB_READ_UTF8STRING(specialInformation);
641 FCB_READ_UTF8STRING(entryTrack);
642 FCB_READ_IA5STRING(numberPlate);
643 FCB_READ_UNCONSTRAINED_INT(price);
644 FCB_READ_SEQUENCE_OF_CUSTOM(vatDetail);
645 FCB_READ_CUSTOM(extension);
648void Fcb::v2::FIPTicketData::decode(UPERDecoder &decoder)
650 decodeSequence(decoder);
651 FCB_READ_IA5STRING(referenceIA5);
652 FCB_READ_UNCONSTRAINED_INT(referenceNum);
653 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
654 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
655 FCB_READ_CONSTRAINED_INT(validFromDay, -1, 700);
656 FCB_READ_CONSTRAINED_INT(validUntilDay, 0, FCB_DATE_MAX);
657 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(activatedDay, 0, FCB_DATE_MAX);
658 FCB_READ_SEQUENCE_OF_CONTRAINED_INT(carrierNum, 1, 32000);
659 FCB_READ_SEQUENCE_OF_IA5STRING(carrierIA5);
662 FCB_READ_ENUM(classCode);
663 FCB_READ_CUSTOM(extension);
666void Fcb::v2::StationPassageData::decode(UPERDecoder &decoder)
668 decodeSequence(decoder);
669 FCB_READ_IA5STRING(referenceIA5);
670 FCB_READ_UNCONSTRAINED_INT(referenceNum);
671 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
672 FCB_READ_INT_IA5_PAIR(productId, 0, FCB_PRODUCT_ID_NUM_MAX);
673 FCB_READ_UTF8STRING(productName);
674 FCB_READ_ENUM(stationCodeTable);
675 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(stationNum);
676 FCB_READ_SEQUENCE_OF_IA5STRING(stationIA5);
677 FCB_READ_SEQUENCE_OF_UTF8STRING(stationNameUTF8);
678 FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT(areaCodeNum);
679 FCB_READ_SEQUENCE_OF_IA5STRING(areaCodeIA5);
680 FCB_READ_SEQUENCE_OF_UTF8STRING(areaNameUTF8);
682 FCB_READ_TIME(validFromTime);
683 FCB_READ_CONSTRAINED_INT(validFromUTCOffset, -60, 60);
684 FCB_READ_CONSTRAINED_INT(validUntilDay, FCB_END_DATE_MIN, FCB_DATE_MAX);
685 FCB_READ_TIME(validUntilTime);
686 FCB_READ_CONSTRAINED_INT(validUntilUTCOffset, -60, 60);
687 FCB_READ_UNCONSTRAINED_INT(numberOfDaysValid);
688 FCB_READ_CUSTOM(extension);
691void Fcb::v2::DelayConfirmation::decode(UPERDecoder &decoder)
693 decodeSequence(decoder);
694 FCB_READ_IA5STRING(referenceIA5);
695 FCB_READ_UNCONSTRAINED_INT(referenceNum);
696 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(train);
697 FCB_READ_CONSTRAINED_INT(departureYear, 2016, 2269);
698 FCB_READ_CONSTRAINED_INT(departureDay, 1, 366);
699 FCB_READ_TIME(departureTime);
700 FCB_READ_CONSTRAINED_INT(departureUTCOffset, -60, 60);
701 FCB_READ_ENUM(stationCodeTable);
702 FCB_READ_INT_IA5_PAIR(station, 1, 9999999);
705 FCB_READ_ENUM(confirmationType);
706 FCB_READ_SEQUENCE_OF_CUSTOM(affectedTickets);
707 FCB_READ_UTF8STRING(infoText);
708 FCB_READ_CUSTOM(extension);
711void Fcb::v2::TokenType::decode(UPERDecoder &decoder)
713 decodeSequence(decoder);
714 FCB_READ_INT_IA5_PAIR_UNCONSTRAINED(tokenProvider);
715 FCB_READ_IA5STRING(tokenSpecification);
719void Fcb::v2::DocumentData::decode(UPERDecoder &decoder)
721 decodeSequence(decoder);
722 FCB_READ_CUSTOM(token);
739void Fcb::v2::TicketLinkType::decode(UPERDecoder &decoder)
741 decodeSequence(decoder);
742 FCB_READ_IA5STRING(referenceIA5);
743 FCB_READ_UNCONSTRAINED_INT(referenceNum);
744 FCB_READ_UTF8STRING(issuerName);
745 FCB_READ_IA5STRING(issuerPNR);
746 FCB_READ_INT_IA5_PAIR(productOwner, 1, 32000);
747 FCB_READ_ENUM(ticketType);
748 FCB_READ_ENUM(linkMode);
751void Fcb::v2::ControlData::decode(UPERDecoder &decoder)
753 decodeSequence(decoder);
754 FCB_READ_SEQUENCE_OF_CUSTOM(identificationByCardReference);
756 identificationByPassportId = decoder.
readBoolean();
757 FCB_READ_UNCONSTRAINED_INT(identificationItem);
758 passportValidationRequired = decoder.
readBoolean();
760 FCB_READ_CONSTRAINED_INT(randomDetailedValidationRequired, 0, 99);
762 reductionCardCheckRequired = decoder.
readBoolean();
763 FCB_READ_UTF8STRING(infoText);
764 FCB_READ_SEQUENCE_OF_CUSTOM(includedTickets);
765 FCB_READ_CUSTOM(extension);
768Fcb::v2::UicRailTicketData::UicRailTicketData() =
default;
770Fcb::v2::UicRailTicketData::UicRailTicketData(
const Uic9183Block &block)
771 : m_data(QVariant::fromValue(block))
779 qCWarning(Log) << decoder.errorMessage();
784Fcb::v2::UicRailTicketData::UicRailTicketData(
const QByteArray &data)
790 qCWarning(
Log) << decoder.errorMessage();
795void Fcb::v2::UicRailTicketData::decode(
UPERDecoder &decoder)
797 decodeSequence(decoder);
798 issuingDetail.decode(decoder);
799 FCB_READ_CUSTOM(travelerDetail);
800 FCB_READ_SEQUENCE_OF_CUSTOM(transportDocument)
801 FCB_READ_CUSTOM(controlDetail)
804bool Fcb::v2::UicRailTicketData::isValid()
const
806 return !m_data.isNull();
809#include "moc_fcbticket2.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.
KI18NLOCALEDATA_EXPORT KCountry country(const char *ianaId)
const char * constData() const const
qsizetype size() const const