| 12714 | namespace Catch { |
| 12715 | |
| 12716 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 12717 | CaseSensitive::Choice caseSensitivity ) |
| 12718 | : m_caseSensitivity( caseSensitivity ), |
| 12719 | m_pattern( adjustCase( pattern ) ) |
| 12720 | { |
| 12721 | if( startsWith( m_pattern, '*' ) ) { |
| 12722 | m_pattern = m_pattern.substr( 1 ); |
| 12723 | m_wildcard = WildcardAtStart; |
| 12724 | } |
| 12725 | if( endsWith( m_pattern, '*' ) ) { |
| 12726 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 12727 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 12728 | } |
| 12729 | } |
| 12730 | |
| 12731 | bool WildcardPattern::matches( std::string const& str ) const { |
| 12732 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected