Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::Matchers::Impl::MatchAnyOf< ArgT > Struct Template Reference

#include <catch_matchers.h>

Inheritance diagram for Catch::Matchers::Impl::MatchAnyOf< ArgT >:
Collaboration diagram for Catch::Matchers::Impl::MatchAnyOf< ArgT >:

Public Member Functions

bool match (ArgT const &arg) const override
 
std::string describe () const override
 
MatchAnyOf< ArgT > & operator|| (MatcherBase< ArgT > const &other)
 
bool match (ArgT const &arg) const override
 
std::string describe () const override
 
MatchAnyOf< ArgT > & operator|| (MatcherBase< ArgT > const &other)
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherBase< ArgT >
MatchAllOf< ArgT > operator&& (MatcherBase const &other) const
 
MatchAllOf< ArgT > operator&& (MatcherBase const &other) const
 
MatchAnyOf< ArgT > operator|| (MatcherBase const &other) const
 
MatchAnyOf< ArgT > operator|| (MatcherBase const &other) const
 
MatchNotOf< ArgT > operator! () const
 
MatchNotOf< ArgT > operator! () 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< ArgT >

Public Attributes

std::vector< MatcherBase< ArgT > const * > m_matchers
 

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

template<typename ArgT>
struct Catch::Matchers::Impl::MatchAnyOf< ArgT >

Definition at line 2965 of file catch.hpp.

Member Function Documentation

◆ describe() [1/2]

template<typename ArgT >
std::string Catch::Matchers::Impl::MatchAnyOf< ArgT >::describe ( ) const
inlineoverridevirtual

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

Definition at line 102 of file catch_matchers.h.

102 {
103 std::string description;
104 description.reserve( 4 + m_matchers.size()*32 );
105 description += "( ";
106 bool first = true;
107 for( auto matcher : m_matchers ) {
108 if( first )
109 first = false;
110 else
111 description += " or ";
112 description += matcher->toString();
113 }
114 description += " )";
115 return description;
116 }
std::vector< MatcherBase< ArgT > const * > m_matchers

◆ describe() [2/2]

template<typename ArgT >
std::string Catch::Matchers::Impl::MatchAnyOf< ArgT >::describe ( ) const
inlineoverridevirtual

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

Definition at line 2974 of file catch.hpp.

2974 {
2975 std::string description;
2976 description.reserve( 4 + m_matchers.size()*32 );
2977 description += "( ";
2978 bool first = true;
2979 for( auto matcher : m_matchers ) {
2980 if( first )
2981 first = false;
2982 else
2983 description += " or ";
2984 description += matcher->toString();
2985 }
2986 description += " )";
2987 return description;
2988 }

◆ match() [1/2]

template<typename ArgT >
bool Catch::Matchers::Impl::MatchAnyOf< ArgT >::match ( ArgT const & arg) const
inlineoverridevirtual

Implements Catch::Matchers::Impl::MatcherMethod< ArgT >.

Definition at line 95 of file catch_matchers.h.

95 {
96 for( auto matcher : m_matchers ) {
97 if (matcher->match(arg))
98 return true;
99 }
100 return false;
101 }

◆ match() [2/2]

template<typename ArgT >
bool Catch::Matchers::Impl::MatchAnyOf< ArgT >::match ( ArgT const & arg) const
inlineoverridevirtual

Implements Catch::Matchers::Impl::MatcherMethod< ArgT >.

Definition at line 2967 of file catch.hpp.

2967 {
2968 for( auto matcher : m_matchers ) {
2969 if (matcher->match(arg))
2970 return true;
2971 }
2972 return false;
2973 }

◆ operator||() [1/2]

template<typename ArgT >
MatchAnyOf< ArgT > & Catch::Matchers::Impl::MatchAnyOf< ArgT >::operator|| ( MatcherBase< ArgT > const & other)
inline

Definition at line 118 of file catch_matchers.h.

118 {
119 m_matchers.push_back( &other );
120 return *this;
121 }

◆ operator||() [2/2]

template<typename ArgT >
MatchAnyOf< ArgT > & Catch::Matchers::Impl::MatchAnyOf< ArgT >::operator|| ( MatcherBase< ArgT > const & other)
inline

Definition at line 2990 of file catch.hpp.

2990 {
2991 m_matchers.push_back( &other );
2992 return *this;
2993 }

Member Data Documentation

◆ m_matchers

template<typename ArgT >
std::vector< MatcherBase< ArgT > const * > Catch::Matchers::Impl::MatchAnyOf< ArgT >::m_matchers

Definition at line 123 of file catch_matchers.h.


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