8#include "linecompare_p.h"
10#include <knowledgedb/linemetadata.h>
12#include <KPublicTransport/Location>
21bool LineUtil::isSameLineNameStrict(
const QString &lhs,
const QString &rhs)
23 return Internal::isSameLineName(lhs, rhs, Internal::StrictCompare);
26bool LineUtil::isSameLineNameFuzzy(
const QString &lhs,
const QString &rhs)
28 return Internal::isSameLineName(lhs, rhs, Internal::FuzzyCompare);
31bool LineUtil::isHighlyIdentifyingName(
QStringView s)
34 && std::any_of(s.
begin(), s.
end(), [](
QChar c) { return c.isDigit(); })
35 && std::any_of(s.
begin(), s.
end(), [](
QChar c) { return c.isLetter(); });
40 if (lhs == rhs || lhs == Line::Unknown || rhs == Line::Unknown) {
44 if (lhs == Line::Train) {
45 return rhs == Line::LocalTrain || rhs == Line::LongDistanceTrain || rhs == Line::RapidTransit;
47 if (rhs == Line::Train) {
48 return lhs == Line::LocalTrain || lhs == Line::LongDistanceTrain || lhs == Line::RapidTransit;
51 if (lhs == Line::Bus) {
54 if (rhs == Line::Bus) {
58 if (lhs == Line::Boat) {
59 return rhs == Line::Ferry;
61 if (rhs == Line::Boat) {
62 return lhs == Line::Ferry;
70 if ((lhs == Line::RapidTransit || lhs == Line::Metro || lhs == Line::Tramway)
71 && (rhs == Line::RapidTransit || rhs == Line::Metro || rhs == Line::Tramway)) {
75 return isCompatibleMode(lhs, rhs);
Mode
Mode of transportation.
@ Shuttle
shuttle bus/coach services, e.g. to/from an airport
Query operations and data types for accessing realtime public transport information from online servi...
const_iterator begin() const const
const_iterator end() const const
qsizetype size() const const