Libosmium: osmium::TagMatcher Class Reference

Libosmium Fast and flexible C++ library for working with OpenStreetMap data

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
osmium::TagMatcher Class Reference

`#include <matcher.hpp>`

Collaboration diagram for osmium::TagMatcher:
[legend]

## Public Member Functions
| TagMatcher ()
bool | has_value_matcher () const noexcept
template<typename TKey, typename X = std::enable_if_t< std::is_convertible<TKey, osmium::StringMatcher>::value, void>>
| TagMatcher (TKey &&key_matcher)
template<typename TKey, typename TValue, typename std::enable_if_t< std::is_convertible< TKey, osmium::StringMatcher >::value, int > = 0, typename std::enable_if_t< std::is_convertible< TValue, osmium::StringMatcher >::value, int > = 0>
| TagMatcher (TKey &&key_matcher, TValue &&value_matcher, bool invert=false)
bool | operator() (const char *key, const char *value) const noexcept
bool | operator() (const osmium::Tag &tag) const noexcept
bool | operator() (const osmium::TagList &tags) const noexcept

## Private Attributes
osmium::StringMatcher | m_key_matcher
osmium::StringMatcher | m_value_matcher
bool | m_has_value_matcher = false
bool | m_result = true

## Detailed Description

Compares a tags key (and value) against the specified StringMatchers.

## Constructor & Destructor Documentation

## ◆ TagMatcher() [1/3]

osmium::TagMatcher::TagMatcher | ( |  | ) |
| inline

Create a default TagMatcher that matches no tags.

## ◆ TagMatcher() [2/3]

template<typename TKey, typename X = std::enable_if_t< std::is_convertible<TKey, osmium::StringMatcher>::value, void>>

osmium::TagMatcher::TagMatcher | ( | TKey && | key_matcher | ) |
| inlineexplicit

Create a TagMatcher matching the key against the specified StringMatcher.

Parameters

  key_matcher | StringMatcher for matching the key.

## ◆ TagMatcher() [3/3]

template<typename TKey, typename TValue, typename std::enable_if_t< std::is_convertible< TKey, osmium::StringMatcher >::value, int > = 0, typename std::enable_if_t< std::is_convertible< TValue, osmium::StringMatcher >::value, int > = 0>

osmium::TagMatcher::TagMatcher | ( | TKey && | key_matcher,
|  | TValue && | value_matcher,
|  | bool | invert = false )
| inline

Create a TagMatcher matching the key and value against the specified StringMatchers.

Parameters

  key_matcher | StringMatcher for matching the key.
  value_matcher | StringMatcher for matching the value.
  invert | If set to true, invert the result of the value_matcher.

## Member Function Documentation

## ◆ has_value_matcher()

bool osmium::TagMatcher::has_value_matcher | ( |  | ) | const
| inlinenoexcept

## ◆ operator()() [1/3]

bool osmium::TagMatcher::operator() | ( | const char * | key,
|  | const char * | value ) const
| inlinenoexcept

Match against the specified key and value.

Returns
  true if the tag matches.

## ◆ operator()() [2/3]

bool osmium::TagMatcher::operator() | ( | const osmium::Tag & | tag | ) | const
| inlinenoexcept

Match against the specified tag.

Returns
  true if the tag matches.

## ◆ operator()() [3/3]

bool osmium::TagMatcher::operator() | ( | const osmium::TagList & | tags | ) | const
| inlinenoexcept

Match against the specified tags.

Returns
  true if any of the tags in the TagList matches.

## Member Data Documentation

## ◆ m_has_value_matcher

bool osmium::TagMatcher::m_has_value_matcher = false
| private

## ◆ m_key_matcher

osmium::StringMatcher osmium::TagMatcher::m_key_matcher
| private

## ◆ m_result

bool osmium::TagMatcher::m_result = true
| private

## ◆ m_value_matcher

osmium::StringMatcher osmium::TagMatcher::m_value_matcher
| private

The documentation for this class was generated from the following file:

- include/osmium/tags/matcher.hpp