KPublicTransport::UicStationCode

KPublicTransport::UicStationCode Namespace Reference

Functions

QStringView country (QStringView id)
 
QString identifierType ()
 
bool isValid (QStringView id, const std::vector< uint8_t > &allowedCountryCodes={})
 

Detailed Description

Utility functions for dealing with UIC station codes.

Also works for the syntactically identical IBNR station codes.

Function Documentation

◆ country()

QStringView KPublicTransport::UicStationCode::country ( QStringView id)
nodiscard

Returns the country code of a given valid UIC station code.

Definition at line 37 of file uicstationcode.cpp.

◆ identifierType()

QString KPublicTransport::UicStationCode::identifierType ( )
nodiscard

The identifier type for use in Location::identifer for UIC station ids.

Definition at line 42 of file uicstationcode.cpp.

◆ isValid()

bool KPublicTransport::UicStationCode::isValid ( QStringView id,
const std::vector< uint8_t > & allowedCountryCodes = {} )
nodiscard

Returns true if id is a valid UIC station code.

@params allowedCountryCodes if non-empty, only UIC station codes with an UIC country code included in that list are considered valid. This list has to be sorted.

Definition at line 15 of file uicstationcode.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.