KPublicTransport

ifoptutil.h
1 /*
2  SPDX-FileCopyrightText: 2021 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KPUBLICTRANSPORT_IFOPTUTIL_H
8 #define KPUBLICTRANSPORT_IFOPTUTIL_H
9 
10 class QString;
11 class QStringView;
12 
13 namespace KPublicTransport {
14 
15 /** Utility functions for dealing with IFOPT (Identification of Fixed Objects in Public Transport).
16  * @see https://wiki.openstreetmap.org/wiki/Key:ref:IFOPT
17  * @see https://en.wikipedia.org/wiki/Identification_of_Fixed_Objects_in_Public_Transport
18  */
19 namespace IfoptUtil
20 {
21 
22 /** Check if @p ifopt is a valid IFOPT identifier. */
23 bool isValid(QStringView ifopt);
24 
25 /** Returns the country identifier for the given (valid!) IFOPT identifier @p ifopt. */
27 
28 /** Returns the stop place identifier for the given (valid!) IFOPT identifier @p ifopt. */
30 
31 /** Returns the stop level identifier for the given (valid!) IFOPT identifier @p ifopt. */
33 
34 /** Checks whether two valid IFOPT ids refer to the same stop place. */
36 
37 /** Merge two IFOPT ids that refer to the same stop place while retaining the maximum level of detail.
38  * Precondition: isValid(lhs) && isValid(rhs) && isSameStopPlace(lhs, rhs)
39  */
41 
42 /** The identifier type for use in @c Location::identifer for IFOPT ids. */
44 
45 }
46 
47 }
48 
49 #endif // KPUBLICTRANSPORT_IFOPTUTIL_H
QStringView stopPlace(QStringView ifopt)
Returns the stop place identifier for the given (valid!) IFOPT identifier ifopt.
Definition: ifoptutil.cpp:48
QStringView country(QStringView ifopt)
Returns the country identifier for the given (valid!) IFOPT identifier ifopt.
Definition: ifoptutil.cpp:43
Query operations and data types for accessing realtime public transport information from online servi...
Definition: attribution.cpp:16
QString identifierType()
The identifier type for use in Location::identifer for IFOPT ids.
Definition: ifoptutil.cpp:83
bool isSameStopPlace(QStringView lhs, QStringView rhs)
Checks whether two valid IFOPT ids refer to the same stop place.
Definition: ifoptutil.cpp:58
QStringView level(QStringView ifopt)
Returns the stop level identifier for the given (valid!) IFOPT identifier ifopt.
Definition: ifoptutil.cpp:53
bool isValid(QStringView ifopt)
Check if ifopt is a valid IFOPT identifier.
Definition: ifoptutil.cpp:14
QStringView merge(QStringView lhs, QStringView rhs)
Merge two IFOPT ids that refer to the same stop place while retaining the maximum level of detail...
Definition: ifoptutil.cpp:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:05:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.