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 | 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

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

private

## 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

StringMatcher{StringMatcher::always_true};
osmium::StringMatcher::always_true
Definition string_matcher.hpp:115
osmium::StringMatcher
Definition string_matcher.hpp:86

or

StringMatcher{StringMatcher::always_false};
osmium::StringMatcher::always_false
Definition string_matcher.hpp:97

## StringMatcher() [3/6]

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

inline

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

StringMatcher{StringMatcher::equal{str}};
osmium::StringMatcher::equal
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{StringMatcher::equal{str}};

## 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

StringMatcher{StringMatcher::list{strings}};
osmium::StringMatcher::list
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

  TMatcher | Must 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:

- include/osmium/util/string_matcher.hpp