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

#include <string_matcher.hpp>

Classes

class  always_false
 
class  always_true
 
class  equal
 
class  list
 
class  match_visitor
 
class  matcher
 
class  prefix
 
class  print_visitor
 
class  substring
 

Public Member Functions

 StringMatcher ()
 
 StringMatcher (bool result)
 
 StringMatcher (const char *str)
 
 StringMatcher (const std::string &str)
 
 StringMatcher (const std::vector< std::string > &strings)
 
template<typename TMatcher , typename X = typename std::enable_if< std::is_base_of<matcher, TMatcher>::value, void>::type>
 StringMatcher (TMatcher &&matcher)
 
bool operator() (const char *str) const noexcept
 
bool operator() (const std::string &str) const noexcept
 
template<typename TChar , typename TTraits >
void print (std::basic_ostream< TChar, TTraits > &out) const
 

Private Types

using matcher_type = boost::variant< always_false, always_true, equal, prefix, substring, list >
 

Private Attributes

matcher_type m_matcher
 

Detailed Description

Implements various string matching functions.

Member Typedef Documentation

◆ matcher_type

Constructor & Destructor Documentation

◆ StringMatcher() [1/6]

osmium::StringMatcher::StringMatcher ( )
inline

Create a string matcher that will never match.

◆ StringMatcher() [2/6]

osmium::StringMatcher::StringMatcher ( bool  result)
inline

Create a string matcher that will always or never match based on the argument. Shortcut for

Definition: string_matcher.hpp:115
Definition: string_matcher.hpp:86

or

◆ StringMatcher() [3/6]

osmium::StringMatcher::StringMatcher ( const char *  str)
inline

Create a string matcher that will match the specified string. Shortcut for

Definition: string_matcher.hpp:133

◆ StringMatcher() [4/6]

osmium::StringMatcher::StringMatcher ( const std::string &  str)
inline

Create a string matcher that will match the specified string. Shortcut for

◆ StringMatcher() [5/6]

osmium::StringMatcher::StringMatcher ( const std::vector< std::string > &  strings)
inline

Create a string matcher that will match if any of the strings match. Shortcut for

Definition: string_matcher.hpp:243

◆ StringMatcher() [6/6]

template<typename TMatcher , typename X = typename std::enable_if< std::is_base_of<matcher, TMatcher>::value, void>::type>
osmium::StringMatcher::StringMatcher ( TMatcher &&  matcher)
inline

Create a string matcher.

Template Parameters
TMatcherMust be one of the matcher classes osmium::StringMatcher::always_false, always_true, equal, prefix, substring, regex or list.

Member Function Documentation

◆ operator()() [1/2]

bool osmium::StringMatcher::operator() ( const char *  str) const
inlinenoexcept

Match the specified string.

◆ operator()() [2/2]

bool osmium::StringMatcher::operator() ( const std::string &  str) const
inlinenoexcept

Match the specified string.

◆ print()

template<typename TChar , typename TTraits >
void osmium::StringMatcher::print ( std::basic_ostream< TChar, TTraits > &  out) const
inline

Member Data Documentation

◆ m_matcher

matcher_type osmium::StringMatcher::m_matcher
private

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