KPublicTransport

ifoptutil.h
1/*
2 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KPUBLICTRANSPORT_IFOPTUTIL_H
8#define KPUBLICTRANSPORT_IFOPTUTIL_H
9
10class QString;
11class QStringView;
12
13namespace 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 */
19namespace IfoptUtil
20{
21
22/** Check if @p ifopt is a valid IFOPT identifier. */
23bool isValid(QStringView ifopt);
24
25/** Returns the country identifier for the given (valid!) IFOPT identifier @p ifopt. */
26QStringView country(QStringView 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
bool isSameStopPlace(QStringView lhs, QStringView rhs)
Checks whether two valid IFOPT ids refer to the same stop place.
Definition ifoptutil.cpp:58
QStringView stopPlace(QStringView ifopt)
Returns the stop place identifier for the given (valid!) IFOPT identifier ifopt.
Definition ifoptutil.cpp:48
QString identifierType()
The identifier type for use in Location::identifer for IFOPT ids.
Definition ifoptutil.cpp:83
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
bool isValid(QStringView ifopt)
Check if ifopt is a valid IFOPT identifier.
Definition ifoptutil.cpp:14
QStringView level(QStringView ifopt)
Returns the stop level identifier for the given (valid!) IFOPT identifier ifopt.
Definition ifoptutil.cpp:53
Query operations and data types for accessing realtime public transport information from online servi...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.