File indexing completed on 2024-05-12 04:42:53

0001 /*
0002     SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KPUBLICTRANSPORT_UICRAILWAYCOACH_H
0007 #define KPUBLICTRANSPORT_UICRAILWAYCOACH_H
0008 
0009 #include <KPublicTransport/Vehicle>
0010 
0011 namespace KPublicTransport {
0012 
0013 /** Methods for parsing UIC railway coach numbers and classification codes.
0014  *  @see https://en.wikipedia.org/wiki/UIC_classification_of_railway_coaches
0015  *  @see https://en.wikipedia.org/wiki/UIC_wagon_numbers
0016  */
0017 namespace UicRailwayCoach
0018 {
0019 
0020 /** Returns the UIC country code from @p coachNumber. */
0021 QStringView countryCode(QStringView coachNumber);
0022 
0023 /** Determine the coach class(es) from a UIC @p coachNumber and/or @p coachClassification.
0024  *  Either one of the arguments can be empty, but the most reliable result is returned with both present.
0025  */
0026 VehicleSection::Classes coachClass(QStringView coachNumber, QStringView coachClassification);
0027 
0028 /** Determine the number of decks from a UIC @p coachNumber and/or @p coachClassification.
0029  *  Either one of the arguments can be empty, but the most reliable result is returned with both present.
0030  */
0031 int deckCount(QStringView coachNumber, QStringView coachClassification);
0032 
0033 /** Determine coach features from a UIC @p coachNumber and/or @p coachClassification.
0034  *  Either one of the arguments can be empty, but the most reliable result is returned with both present.
0035  */
0036 VehicleSection::Features features(QStringView coachNumber, QStringView coachClassification);
0037 
0038 /** Determine the vehicle type from a UIC @p coachNumber and/or @p coachClassification.
0039  *  Either one of the arguments can be empty, but the most reliable result is returned with both present.
0040  */
0041 VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification);
0042 
0043 }
0044 
0045 }
0046 
0047 #endif // KPUBLICTRANSPORT_UICRAILWAYCOACH_H