GeoDesk for C++
Fast and storage-efficient spatial database engine for OpenStreetMap features
Loading...
Searching...
No Matches
geodesk::TagValue Class Reference

The value of a Tag. More...

#include <TagValue.h>

Public Member Functions

 TagValue ()
 
 TagValue (uint64_t taggedNumberValue, StringValue str=StringValue())
 
 TagValue (StringValue str)
 
 operator double () const noexcept
 
 operator int64_t () const noexcept
 
 operator int () const noexcept
 
 operator bool () const noexcept
 
bool operator! () const noexcept
 
bool operator== (const TagValue &other) const noexcept
 
bool operator!= (const TagValue &other) const noexcept
 
bool operator== (const std::string_view &sv) const noexcept
 
bool operator== (double val) const noexcept
 
bool operator== (int64_t val) const noexcept
 
bool operator!= (const std::string_view &val) const noexcept
 
bool operator!= (double val) const noexcept
 
bool operator!= (int64_t val) const noexcept
 
bool operator< (const TagValue &other) const noexcept
 
bool operator< (double val) const noexcept
 
bool operator> (double val) const noexcept
 
bool operator<= (double val) const noexcept
 
bool operator>= (double val) const noexcept
 
bool operator< (int64_t val) const noexcept
 
bool operator> (int64_t val) const noexcept
 
bool operator<= (int64_t val) const noexcept
 
bool operator>= (int64_t val) const noexcept
 
bool operator< (int val) const noexcept
 
bool operator> (int val) const noexcept
 
bool operator<= (int val) const noexcept
 
bool operator>= (int val) const noexcept
 

Friends

template<typename Stream >
Stream & operator<< (Stream &out, const TagValue &v)
 

Detailed Description

The value of a Tag.

Converts implicitly to std::string, double, int or bool.

  • double: NaN if the string value does not start with a valid number
  • int: 0 if the string value does not start with a valid number
  • bool: true unless empty string, "no", or a numerical value of 0

Warning: A TagValue object is a lightweight wrapper around a pointer to a Feature's tag data, contained in a FeatureStore. It becomes invalid once that FeatureStore is closed. To use its value beyond the lifetime of the FeatureStore, convert it to a std::string (which allocates a copy of the tag data), or one of the supported scalar types.

See also
Tag, Tags

Constructor & Destructor Documentation

◆ TagValue() [1/3]

geodesk::TagValue::TagValue ( )
inline

◆ TagValue() [2/3]

geodesk::TagValue::TagValue ( uint64_t taggedNumberValue,
StringValue str = StringValue() )
inlineexplicit

◆ TagValue() [3/3]

geodesk::TagValue::TagValue ( StringValue str)
inline

Member Function Documentation

◆ operator bool()

geodesk::TagValue::operator bool ( ) const
inlinenoexcept

◆ operator double()

geodesk::TagValue::operator double ( ) const
inlinenoexcept

◆ operator int()

geodesk::TagValue::operator int ( ) const
inlinenoexcept

◆ operator int64_t()

geodesk::TagValue::operator int64_t ( ) const
inlinenoexcept

◆ operator!()

bool geodesk::TagValue::operator! ( ) const
inlinenoexcept

◆ operator!=() [1/4]

bool geodesk::TagValue::operator!= ( const std::string_view & val) const
inlinenoexcept

◆ operator!=() [2/4]

bool geodesk::TagValue::operator!= ( const TagValue & other) const
inlinenoexcept

◆ operator!=() [3/4]

bool geodesk::TagValue::operator!= ( double val) const
inlinenoexcept

◆ operator!=() [4/4]

bool geodesk::TagValue::operator!= ( int64_t val) const
inlinenoexcept

◆ operator<() [1/4]

bool geodesk::TagValue::operator< ( const TagValue & other) const
inlinenoexcept

◆ operator<() [2/4]

bool geodesk::TagValue::operator< ( double val) const
inlinenoexcept

◆ operator<() [3/4]

bool geodesk::TagValue::operator< ( int val) const
inlinenoexcept

◆ operator<() [4/4]

bool geodesk::TagValue::operator< ( int64_t val) const
inlinenoexcept

◆ operator<=() [1/3]

bool geodesk::TagValue::operator<= ( double val) const
inlinenoexcept

◆ operator<=() [2/3]

bool geodesk::TagValue::operator<= ( int val) const
inlinenoexcept

◆ operator<=() [3/3]

bool geodesk::TagValue::operator<= ( int64_t val) const
inlinenoexcept

◆ operator==() [1/4]

bool geodesk::TagValue::operator== ( const std::string_view & sv) const
inlinenoexcept

◆ operator==() [2/4]

bool geodesk::TagValue::operator== ( const TagValue & other) const
noexcept

◆ operator==() [3/4]

bool geodesk::TagValue::operator== ( double val) const
inlinenoexcept

◆ operator==() [4/4]

bool geodesk::TagValue::operator== ( int64_t val) const
inlinenoexcept

◆ operator>() [1/3]

bool geodesk::TagValue::operator> ( double val) const
inlinenoexcept

◆ operator>() [2/3]

bool geodesk::TagValue::operator> ( int val) const
inlinenoexcept

◆ operator>() [3/3]

bool geodesk::TagValue::operator> ( int64_t val) const
inlinenoexcept

◆ operator>=() [1/3]

bool geodesk::TagValue::operator>= ( double val) const
inlinenoexcept

◆ operator>=() [2/3]

bool geodesk::TagValue::operator>= ( int val) const
inlinenoexcept

◆ operator>=() [3/3]

bool geodesk::TagValue::operator>= ( int64_t val) const
inlinenoexcept

Friends And Related Symbol Documentation

◆ operator<<

template<typename Stream >
Stream & operator<< ( Stream & out,
const TagValue & v )
friend

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