| 15400 | namespace Catch { |
| 15401 | |
| 15402 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 15403 | CaseSensitive::Choice caseSensitivity ) |
| 15404 | : m_caseSensitivity( caseSensitivity ), |
| 15405 | m_pattern( normaliseString( pattern ) ) |
| 15406 | { |
| 15407 | if( startsWith( m_pattern, '*' ) ) { |
| 15408 | m_pattern = m_pattern.substr( 1 ); |
| 15409 | m_wildcard = WildcardAtStart; |
| 15410 | } |
| 15411 | if( endsWith( m_pattern, '*' ) ) { |
| 15412 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 15413 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 15414 | } |
| 15415 | } |
| 15416 | |
| 15417 | bool WildcardPattern::matches( std::string const& str ) const { |
| 15418 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected