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

#include <gmock-matchers.h>

Public Member Functions

 EndsWithMatcher (const StringType &suffix)
 
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::EndsWithMatcher< StringType >

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

Constructor & Destructor Documentation

◆ EndsWithMatcher()

template<typename StringType >
testing::internal::EndsWithMatcher< StringType >::EndsWithMatcher ( const StringType &  suffix)
inlineexplicit

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

1283 : suffix_(suffix) {}

Member Function Documentation

◆ DescribeNegationTo()

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

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

1312  {
1313  *os << "doesn't end with ";
1314  UniversalPrint(suffix_, os);
1315  }
void UniversalPrint(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ DescribeTo()

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

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

1307  {
1308  *os << "ends with ";
1309  UniversalPrint(suffix_, os);
1310  }
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::EndsWithMatcher< StringType >::MatchAndExplain ( CharType *  s,
MatchResultListener listener 
) const
inline

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

1291  {
1292  return s != NULL && MatchAndExplain(StringType(s), listener);
1293  }
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const

◆ MatchAndExplain() [2/2]

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

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

1301  {
1302  const StringType& s2(s);
1303  return s2.length() >= suffix_.length() &&
1304  s2.substr(s2.length() - suffix_.length()) == suffix_;
1305  }

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