Electroneum
testing::internal::MatchesRegexMatcher Class Reference

#include <gmock-matchers.h>

Public Member Functions

 MatchesRegexMatcher (const RE *regex, bool full_match)
 
template<typename CharType >
bool MatchAndExplain (CharType *s, MatchResultListener *listener) const
 
template<class MatcheeStringType >
bool MatchAndExplain (const MatcheeStringType &s, MatchResultListener *) const
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 

Detailed Description

Definition at line 1326 of file gmock-matchers.h.

Constructor & Destructor Documentation

◆ MatchesRegexMatcher()

testing::internal::MatchesRegexMatcher::MatchesRegexMatcher ( const RE regex,
bool  full_match 
)
inline

Definition at line 1328 of file gmock-matchers.h.

1329  : regex_(regex), full_match_(full_match) {}

Member Function Documentation

◆ DescribeNegationTo()

void testing::internal::MatchesRegexMatcher::DescribeNegationTo ( ::std::ostream *  os) const
inline

Definition at line 1359 of file gmock-matchers.h.

1359  {
1360  *os << "doesn't " << (full_match_ ? "match" : "contain")
1361  << " regular expression ";
1362  UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
1363  }
static void Print(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ DescribeTo()

void testing::internal::MatchesRegexMatcher::DescribeTo ( ::std::ostream *  os) const
inline

Definition at line 1353 of file gmock-matchers.h.

1353  {
1354  *os << (full_match_ ? "matches" : "contains")
1355  << " regular expression ";
1356  UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
1357  }
static void Print(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ MatchAndExplain() [1/2]

template<typename CharType >
bool testing::internal::MatchesRegexMatcher::MatchAndExplain ( CharType *  s,
MatchResultListener listener 
) const
inline

Definition at line 1337 of file gmock-matchers.h.

1337  {
1338  return s != NULL && MatchAndExplain(internal::string(s), listener);
1339  }
::std::string string
Definition: gtest-port.h:1097
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const

◆ MatchAndExplain() [2/2]

template<class MatcheeStringType >
bool testing::internal::MatchesRegexMatcher::MatchAndExplain ( const MatcheeStringType &  s,
MatchResultListener  
) const
inline

Definition at line 1346 of file gmock-matchers.h.

1347  {
1348  const internal::string& s2(s);
1349  return full_match_ ? RE::FullMatch(s2, *regex_) :
1350  RE::PartialMatch(s2, *regex_);
1351  }
::std::string string
Definition: gtest-port.h:1097
static bool FullMatch(const ::std::string &str, const RE &re)
Definition: gtest-port.h:1184
Here is the call graph for this function:

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