Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Member Functions | List of all members
osmium::TagList Class Reference

#include <tag.hpp>

Inheritance diagram for osmium::TagList:
Inheritance graph
[legend]
Collaboration diagram for osmium::TagList:
Collaboration graph
[legend]

Public Member Functions

 TagList () noexcept=default
 
const char * get_value_by_key (const char *key, const char *default_value=nullptr) const noexcept
 
const char * operator[] (const char *key) const noexcept
 
bool has_key (const char *key) const noexcept
 
bool has_tag (const char *key, const char *value) const noexcept
 
- Public Member Functions inherited from osmium::memory::Collection< Tag, osmium::item_type::tag_list >
 Collection () noexcept
 
bool empty () const noexcept
 
size_type size () const noexcept
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
- Public Member Functions inherited from osmium::memory::Item
 Item (const Item &)=delete
 
Itemoperator= (const Item &)=delete
 
 Item (Item &&)=delete
 
Itemoperator= (Item &&)=delete
 
 ~Item () noexcept=default
 
unsigned char * next () noexcept
 
const unsigned char * next () const noexcept
 
item_size_type byte_size () const noexcept
 
item_size_type padded_size () const
 
item_type type () const noexcept
 
bool removed () const noexcept
 
void set_removed (const bool removed) noexcept
 
diff_indicator_type diff () const noexcept
 
char diff_as_char () const noexcept
 
void set_diff (const diff_indicator_type diff) noexcept
 

Private Member Functions

const_iterator find_key (const char *key) const noexcept
 

Additional Inherited Members

- Public Types inherited from osmium::memory::Collection< Tag, osmium::item_type::tag_list >
using value_type = Tag
 
using reference = Tag &
 
using const_reference = const Tag &
 
using iterator = CollectionIterator< Tag >
 
using const_iterator = CollectionIterator< const Tag >
 
using size_type = std::size_t
 
- Static Public Member Functions inherited from osmium::memory::Collection< Tag, osmium::item_type::tag_list >
static constexpr bool is_compatible_to (const osmium::item_type t) noexcept
 
- Static Public Member Functions inherited from osmium::memory::Item
static constexpr bool is_compatible_to (osmium::item_type) noexcept
 
- Static Public Attributes inherited from osmium::memory::Collection< Tag, osmium::item_type::tag_list >
static constexpr osmium::item_type itemtype
 
- Protected Member Functions inherited from osmium::memory::Item
 Item (item_size_type size=0, item_type type=item_type{}) noexcept
 
Itemset_type (const item_type item_type) noexcept
 

Constructor & Destructor Documentation

◆ TagList()

osmium::TagList::TagList ( )
defaultnoexcept

Member Function Documentation

◆ find_key()

const_iterator osmium::TagList::find_key ( const char *  key) const
inlineprivatenoexcept

◆ get_value_by_key()

const char * osmium::TagList::get_value_by_key ( const char *  key,
const char *  default_value = nullptr 
) const
inlinenoexcept

Get tag value for the given tag key. If the key is not set, returns the default_value.

Precondition
key != nullptr

◆ has_key()

bool osmium::TagList::has_key ( const char *  key) const
inlinenoexcept

Returns true if the tag with the given key is in the tag list.

Precondition
key != nullptr

◆ has_tag()

bool osmium::TagList::has_tag ( const char *  key,
const char *  value 
) const
inlinenoexcept

Returns true if the tag with the given key and value is in the tag list.

Precondition
key != nullptr && value != nullptr

◆ operator[]()

const char * osmium::TagList::operator[] ( const char *  key) const
inlinenoexcept

Get tag value for the given tag key. If the key is not set, returns nullptr.

Precondition
key != nullptr

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