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

#include <gmock-matchers.h>

Public Member Functions

 StrEqualityMatcher (const StringType &str, bool expect_eq, bool case_sensitive)
 
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::StrEqualityMatcher< StringType >

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

Constructor & Destructor Documentation

◆ StrEqualityMatcher()

template<typename StringType >
testing::internal::StrEqualityMatcher< StringType >::StrEqualityMatcher ( const StringType &  str,
bool  expect_eq,
bool  case_sensitive 
)
inline

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

1130  : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}

Member Function Documentation

◆ DescribeNegationTo()

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

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

1162  {
1163  DescribeToHelper(!expect_eq_, os);
1164  }

◆ DescribeTo()

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

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

1158  {
1159  DescribeToHelper(expect_eq_, os);
1160  }

◆ MatchAndExplain() [1/2]

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

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

1138  {
1139  if (s == NULL) {
1140  return !expect_eq_;
1141  }
1142  return MatchAndExplain(StringType(s), listener);
1143  }
bool MatchAndExplain(CharType *s, MatchResultListener *listener) const

◆ MatchAndExplain() [2/2]

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

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

1151  {
1152  const StringType& s2(s);
1153  const bool eq = case_sensitive_ ? s2 == string_ :
1154  CaseInsensitiveStringEquals(s2, string_);
1155  return expect_eq_ == eq;
1156  }
bool CaseInsensitiveStringEquals(const StringType &s1, const StringType &s2)
Here is the call graph for this function:

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