Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::Matchers::StdString::RegexMatcher Struct Reference

#include <catch_matchers_string.h>

Inheritance diagram for Catch::Matchers::StdString::RegexMatcher:
Collaboration diagram for Catch::Matchers::StdString::RegexMatcher:

Public Member Functions

 RegexMatcher (std::string regex, CaseSensitive::Choice caseSensitivity)
 
bool match (std::string const &matchee) const override
 
std::string describe () const override
 
 RegexMatcher (std::string regex, CaseSensitive::Choice caseSensitivity)
 
bool match (std::string const &matchee) const override
 
std::string describe () const override
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherBase< T >
MatchAllOf< Toperator&& (MatcherBase const &other) const
 
MatchAnyOf< Toperator|| (MatcherBase const &other) const
 
MatchNotOf< Toperator! () const
 
MatchAllOf< Toperator&& (MatcherBase const &other) const
 
MatchAnyOf< Toperator|| (MatcherBase const &other) const
 
MatchNotOf< Toperator! () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherUntypedBase
 MatcherUntypedBase ()=default
 
 MatcherUntypedBase (MatcherUntypedBase const &)=default
 
MatcherUntypedBaseoperator= (MatcherUntypedBase const &)=delete
 
std::string toString () const
 
 MatcherUntypedBase ()=default
 
 MatcherUntypedBase (MatcherUntypedBase const &)=default
 
MatcherUntypedBaseoperator= (MatcherUntypedBase const &)=delete
 
std::string toString () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherMethod< T >
virtual bool match (T const &arg) const=0
 
virtual bool match (T const &arg) const=0
 

Additional Inherited Members

- Protected Member Functions inherited from Catch::Matchers::Impl::MatcherUntypedBase
virtual ~MatcherUntypedBase ()
 
virtual ~MatcherUntypedBase ()
 
- Protected Attributes inherited from Catch::Matchers::Impl::MatcherUntypedBase
std::string m_cachedToString
 

Detailed Description

Definition at line 3171 of file catch.hpp.

Constructor & Destructor Documentation

◆ RegexMatcher() [1/2]

Catch::Matchers::StdString::RegexMatcher::RegexMatcher ( std::string regex,
CaseSensitive::Choice caseSensitivity )

Definition at line 82 of file catch_matchers_string.cpp.

82: m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {}

◆ RegexMatcher() [2/2]

Catch::Matchers::StdString::RegexMatcher::RegexMatcher ( std::string regex,
CaseSensitive::Choice caseSensitivity )

Member Function Documentation

◆ describe() [1/2]

std::string Catch::Matchers::StdString::RegexMatcher::describe ( ) const
overridevirtual

Implements Catch::Matchers::Impl::MatcherUntypedBase.

Definition at line 93 of file catch_matchers_string.cpp.

93 {
94 return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Choice::Yes)? " case sensitively" : " case insensitively");
95 }
std::string stringify(const T &e)
Here is the call graph for this function:

◆ describe() [2/2]

std::string Catch::Matchers::StdString::RegexMatcher::describe ( ) const
overridevirtual

◆ match() [1/2]

bool Catch::Matchers::StdString::RegexMatcher::match ( std::string const & matchee) const
override

Definition at line 84 of file catch_matchers_string.cpp.

84 {
85 auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
86 if (m_caseSensitivity == CaseSensitive::Choice::No) {
87 flags |= std::regex::icase;
88 }
89 auto reg = std::regex(m_regex, flags);
90 return std::regex_match(matchee, reg);
91 }
pInfo flags

◆ match() [2/2]

bool Catch::Matchers::StdString::RegexMatcher::match ( std::string const & matchee) const
override

The documentation for this struct was generated from the following files: