Libosmium  2.22.0
Fast and flexible C++ library for working with OpenStreetMap data
Loading...
Searching...
No Matches
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  regex
 
class  substring
 

Public Member Functions

 StringMatcher ()
 
 StringMatcher (bool result)
 
 StringMatcher (const char *str)
 
 StringMatcher (const std::string &str)
 
 StringMatcher (const std::regex &aregex)
 
 StringMatcher (const std::vector< std::string > &strings)
 
template<typename TMatcher, typename X = std::enable_if_t< std::is_base_of<matcher, TMatcher>::value, void>>
 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
 

Private Attributes

matcher_type m_matcher
 

Detailed Description

Implements various string matching functions.

Member Typedef Documentation

◆ matcher_type

Initial value:
boost::variant
Definition string_matcher.hpp:73
Definition string_matcher.hpp:91
Definition string_matcher.hpp:109
Definition string_matcher.hpp:217
Definition string_matcher.hpp:137
Definition string_matcher.hpp:193
Definition string_matcher.hpp:165

Constructor & Destructor Documentation

◆ StringMatcher() [1/7]

osmium::StringMatcher::StringMatcher ( )
inline

Create a string matcher that will never match.

◆ StringMatcher() [2/7]

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

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

StringMatcher()
Definition string_matcher.hpp:323

or

◆ StringMatcher() [3/7]

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

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

◆ StringMatcher() [4/7]

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

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

◆ StringMatcher() [5/7]

osmium::StringMatcher::StringMatcher ( const std::regex & aregex)
inline

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

◆ StringMatcher() [6/7]

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

◆ StringMatcher() [7/7]

template<typename TMatcher, typename X = std::enable_if_t< std::is_base_of<matcher, TMatcher>::value, void>>
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: