| 12442 | namespace Catch { |
| 12443 | |
| 12444 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 12445 | CaseSensitive::Choice caseSensitivity ) |
| 12446 | : m_caseSensitivity( caseSensitivity ), |
| 12447 | m_pattern( adjustCase( pattern ) ) |
| 12448 | { |
| 12449 | if( startsWith( m_pattern, '*' ) ) { |
| 12450 | m_pattern = m_pattern.substr( 1 ); |
| 12451 | m_wildcard = WildcardAtStart; |
| 12452 | } |
| 12453 | if( endsWith( m_pattern, '*' ) ) { |
| 12454 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 12455 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 12456 | } |
| 12457 | } |
| 12458 | |
| 12459 | bool WildcardPattern::matches( std::string const& str ) const { |
| 12460 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected