Electroneum
testing::internal::HasSubstrMatcher< StringType > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

 HasSubstrMatcher (const StringType &substring)
 
template<typename CharType >
bool MatchAndExplain (CharType *s, MatchResultListener *listener) const
 
template<typename MatcheeStringType >
bool MatchAndExplain (const MatcheeStringType &s, MatchResultListener *) const
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 

Detailed Description

template<typename StringType>
class testing::internal::HasSubstrMatcher< StringType >

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

Constructor & Destructor Documentation

◆ HasSubstrMatcher()

template<typename StringType >
testing::internal::HasSubstrMatcher< StringType >::HasSubstrMatcher ( const StringType &  substring)
inlineexplicit

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

1190  : substring_(substring) {}

Member Function Documentation

◆ DescribeNegationTo()

template<typename StringType >
void testing::internal::HasSubstrMatcher< StringType >::DescribeNegationTo ( ::std::ostream *  os) const
inline

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

1219  {
1220  *os << "has no substring ";
1221  UniversalPrint(substring_, os);
1222  }
void UniversalPrint(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ DescribeTo()

template<typename StringType >
void testing::internal::HasSubstrMatcher< StringType >::DescribeTo ( ::std::ostream *  os) const
inline

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

1214  {
1215  *os << "has substring ";
1216  UniversalPrint(substring_, os);
1217  }
void UniversalPrint(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ MatchAndExplain() [1/2]

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

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

1198  {
1199  return s != NULL && MatchAndExplain(StringType(s), listener);
1200  }
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const

◆ MatchAndExplain() [2/2]

template<typename StringType >
template<typename MatcheeStringType >
bool testing::internal::HasSubstrMatcher< StringType >::MatchAndExplain ( const MatcheeStringType &  s,
MatchResultListener  
) const
inline

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

1208  {
1209  const StringType& s2(s);
1210  return s2.find(substring_) != StringType::npos;
1211  }

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