KOSMIndoorMap

osmelement.cpp
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "osmelement.h"
8
9#include <QLocale>
10
11using namespace KOSMIndoorMap;
12
13OSMElement::OSMElement() = default;
14OSMElement::OSMElement(OSM::Element e)
15 : m_element(e)
16{
17}
18
19OSMElement::~OSMElement() = default;
20
21bool OSMElement::isNull() const
22{
23 return m_element.type() == OSM::Type::Null;
24}
25
26QString OSMElement::name() const
27{
28 return QString::fromUtf8(m_element.tagValue(OSM::Languages::fromQLocale(QLocale()), "name"));
29}
30
31QString OSMElement::url() const
32{
33 return m_element.url();
34}
35
36QString OSMElement::tagValue(const QString &key) const
37{
38 return QString::fromUtf8(m_element.tagValue(key.toUtf8().constData()));
39}
40
41OSM::Element OSMElement::element() const
42{
43 return m_element;
44}
45
46#include "moc_osmelement.cpp"
A reference to any of OSM::Node/OSM::Way/OSM::Relation.
Definition element.h:24
static KOSM_EXPORT Languages fromQLocale(const QLocale &locale)
Convert QLocale::uiLanguages() into an OSM::Languages set.
Definition languages.cpp:40
OSM-based multi-floor indoor maps for buildings.
const char * constData() const const
QString fromUtf8(QByteArrayView str)
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.