| 15391 | namespace Catch { |
| 15392 | |
| 15393 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 15394 | CaseSensitive::Choice caseSensitivity ) |
| 15395 | : m_caseSensitivity( caseSensitivity ), |
| 15396 | m_pattern( normaliseString( pattern ) ) |
| 15397 | { |
| 15398 | if( startsWith( m_pattern, '*' ) ) { |
| 15399 | m_pattern = m_pattern.substr( 1 ); |
| 15400 | m_wildcard = WildcardAtStart; |
| 15401 | } |
| 15402 | if( endsWith( m_pattern, '*' ) ) { |
| 15403 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 15404 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 15405 | } |
| 15406 | } |
| 15407 | |
| 15408 | bool WildcardPattern::matches( std::string const& str ) const { |
| 15409 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected