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 = boost::variant< always_false, always_true, equal, prefix, substring, regex, 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, regex, list>

private

## 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{StringMatcher::always_true};
osmium::StringMatcher::always_true
Definition string_matcher.hpp:91
osmium::StringMatcher
Definition string_matcher.hpp:62

or

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

## StringMatcher() [3/7]

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

## StringMatcher() [4/7]

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

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

inline

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

StringMatcher{StringMatcher::regex{aregex}};
osmium::StringMatcher::regex
Definition string_matcher.hpp:193

## 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{StringMatcher::list{strings}};
osmium::StringMatcher::list
Definition string_matcher.hpp:217

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

  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

inline noexcept

Match the specified string.

## operator()() [2/2]

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

inline noexcept

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