MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / WildcardPattern

Method WildcardPattern

extlibs/catch/include/catch/catch.hpp:14635–14648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14633namespace Catch {
14634
14635 WildcardPattern::WildcardPattern( std::string const& pattern,
14636 CaseSensitive::Choice caseSensitivity )
14637 : m_caseSensitivity( caseSensitivity ),
14638 m_pattern( adjustCase( pattern ) )
14639 {
14640 if( startsWith( m_pattern, '*' ) ) {
14641 m_pattern = m_pattern.substr( 1 );
14642 m_wildcard = WildcardAtStart;
14643 }
14644 if( endsWith( m_pattern, '*' ) ) {
14645 m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
14646 m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
14647 }
14648 }
14649
14650 bool WildcardPattern::matches( std::string const& str ) const {
14651 switch( m_wildcard ) {

Callers

nothing calls this directly

Calls 4

substrMethod · 0.80
startsWithFunction · 0.70
endsWithFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected