ManaPlus
Public Member Functions | Private Attributes
Catch::Matchers::Impl::Generic::AnyOf< ExpressionT > Class Template Reference

#include <catch.hpp>

Inheritance diagram for Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >:
Catch::Matchers::Impl::MatcherImpl< AnyOf< ExpressionT >, ExpressionT > Catch::Matchers::Impl::Matcher< ExpressionT > Catch::SharedImpl< IShared > Catch::IShared Catch::NonCopyable

Public Member Functions

 AnyOf ()
 
 AnyOf (AnyOf const &other)
 
AnyOfadd (Matcher< ExpressionT > const &matcher)
 
virtual bool match (ExpressionT const &expr) const
 
virtual std::string toString () const
 
AnyOf operator|| (Matcher< ExpressionT > const &other) const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherImpl< AnyOf< ExpressionT >, ExpressionT >
virtual Ptr< Matcher< ExpressionT > > clone () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::Matcher< ExpressionT >
virtual ~Matcher ()
 
Generic::AllOf< ExpressionT > operator&& (Matcher< ExpressionT > const &other) const
 
Generic::AnyOf< ExpressionT > operator|| (Matcher< ExpressionT > const &other) const
 
Generic::Not< ExpressionT > operator! () const
 
- Public Member Functions inherited from Catch::SharedImpl< IShared >
 SharedImpl ()
 
virtual void addRef () const
 
virtual void release () const
 
- Public Member Functions inherited from Catch::IShared
virtual ~IShared ()
 

Private Attributes

std::vector< Ptr< Matcher< ExpressionT > > > m_matchers
 

Additional Inherited Members

- Public Types inherited from Catch::Matchers::Impl::Matcher< ExpressionT >
typedef ExpressionT ExpressionType
 
- Data Fields inherited from Catch::SharedImpl< IShared >
unsigned int m_rc
 
- Protected Member Functions inherited from Catch::NonCopyable
 NonCopyable ()
 
virtual ~NonCopyable ()
 

Detailed Description

template<typename ExpressionT>
class Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >

Definition at line 983 of file catch.hpp.

Constructor & Destructor Documentation

◆ AnyOf() [1/2]

template<typename ExpressionT >
Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::AnyOf ( )
inline

Definition at line 986 of file catch.hpp.

986 {}

◆ AnyOf() [2/2]

template<typename ExpressionT >
Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::AnyOf ( AnyOf< ExpressionT > const &  other)
inline

Definition at line 987 of file catch.hpp.

987 : m_matchers( other.m_matchers ) {}
std::vector< Ptr< Matcher< ExpressionT > > > m_matchers
Definition: catch.hpp:1019

Member Function Documentation

◆ add()

template<typename ExpressionT >
AnyOf& Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::add ( Matcher< ExpressionT > const &  matcher)
inline

◆ match()

template<typename ExpressionT >
virtual bool Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::match ( ExpressionT const &  expr) const
inlinevirtual

Implements Catch::Matchers::Impl::Matcher< ExpressionT >.

Definition at line 993 of file catch.hpp.

994  {
995  for( std::size_t i = 0; i < m_matchers.size(); ++i )
996  if( m_matchers[i]->match( expr ) )
997  return true;
998  return false;
999  }
virtual bool match(ExpressionT const &expr) const
Definition: catch.hpp:993

◆ operator||()

template<typename ExpressionT >
AnyOf Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::operator|| ( Matcher< ExpressionT > const &  other) const
inline

Definition at line 1012 of file catch.hpp.

1012  {
1013  AnyOf anyOfExpr( *this );
1014  anyOfExpr.add( other );
1015  return anyOfExpr;
1016  }

References Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::add().

◆ toString()

template<typename ExpressionT >
virtual std::string Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::toString ( ) const
inlinevirtual

Implements Catch::Matchers::Impl::Matcher< ExpressionT >.

Definition at line 1000 of file catch.hpp.

1000  {
1001  std::ostringstream oss;
1002  oss << "( ";
1003  for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
1004  if( i != 0 )
1005  oss << " or ";
1006  oss << m_matchers[i]->toString();
1007  }
1008  oss << " )";
1009  return oss.str();
1010  }

Field Documentation

◆ m_matchers

template<typename ExpressionT >
std::vector<Ptr<Matcher<ExpressionT> > > Catch::Matchers::Impl::Generic::AnyOf< ExpressionT >::m_matchers
private

Definition at line 1019 of file catch.hpp.


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