| 10926 | namespace Catch { |
| 10927 | |
| 10928 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 10929 | CaseSensitive::Choice caseSensitivity ) |
| 10930 | : m_caseSensitivity( caseSensitivity ), |
| 10931 | m_pattern( adjustCase( pattern ) ) |
| 10932 | { |
| 10933 | if( startsWith( m_pattern, '*' ) ) { |
| 10934 | m_pattern = m_pattern.substr( 1 ); |
| 10935 | m_wildcard = WildcardAtStart; |
| 10936 | } |
| 10937 | if( endsWith( m_pattern, '*' ) ) { |
| 10938 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 10939 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 10940 | } |
| 10941 | } |
| 10942 | |
| 10943 | bool WildcardPattern::matches( std::string const& str ) const { |
| 10944 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected