| 14633 | namespace 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 ) { |
nothing calls this directly
no test coverage detected