Class MatchExpr

Synopsis

#include <include/internal/catch_capture_matchers.h>

template<typename ArgT, typename MatcherT>
class MatchExpr : public ITransientExpression

Description

No description yet.

Inheritance

Ancestors: ITransientExpression

Methods

MatchExpr
streamReconstructedExpression

Source

Lines 22-43 in include/internal/catch_capture_matchers.h.

template<typename ArgT, typename MatcherT>
class MatchExpr : public ITransientExpression {
    ArgT const& m_arg;
    MatcherT m_matcher;
    StringRef m_matcherString;
public:
    MatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString )
    :   ITransientExpression{ true, matcher.match( arg ) },
        m_arg( arg ),
        m_matcher( matcher ),
        m_matcherString( matcherString )
    {}
    void streamReconstructedExpression( std::ostream &os ) const override {
        auto matcherAsString = m_matcher.toString();
        os << Catch::Detail::stringify( m_arg ) << ' ';
        if( matcherAsString == Detail::unprintableString )
            os << m_matcherString;
        else
            os << matcherAsString;
    }
};





Add Discussion as Guest

Log in