Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KOSMIndoorMap
Commits
07ac96a6
Commit
07ac96a6
authored
Dec 23, 2020
by
Volker Krause
Browse files
Add Element::hasTag method
Helpful during merging elements.
parent
220cd929
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/osm/element.cpp
View file @
07ac96a6
...
...
@@ -111,6 +111,11 @@ QByteArray Element::tagValue(const char *keyName, const QLocale &locale) const
return
{};
}
bool
Element
::
hasTag
(
TagKey
key
)
const
{
return
std
::
binary_search
(
tagsBegin
(),
tagsEnd
(),
key
);
}
std
::
vector
<
Tag
>::
const_iterator
OSM
::
Element
::
tagsBegin
()
const
{
switch
(
type
())
{
...
...
src/osm/element.h
View file @
07ac96a6
...
...
@@ -50,6 +50,8 @@ public:
template
<
typename
K
,
typename
...
Args
>
QByteArray
tagValue
(
K
key
,
Args
...
args
,
const
QLocale
&
locale
)
const
;
/** Returns whether or not this element has any tags set. */
inline
bool
hasTags
()
const
{
return
std
::
distance
(
tagsBegin
(),
tagsEnd
())
>
0
;
}
/** Returns @c true if this element has a tag with key @p key. */
bool
hasTag
(
TagKey
key
)
const
;
std
::
vector
<
Tag
>::
const_iterator
tagsBegin
()
const
;
std
::
vector
<
Tag
>::
const_iterator
tagsEnd
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment