| 15061 | namespace Catch { |
| 15062 | |
| 15063 | WildcardPattern::WildcardPattern( std::string const& pattern, |
| 15064 | CaseSensitive::Choice caseSensitivity ) |
| 15065 | : m_caseSensitivity( caseSensitivity ), |
| 15066 | m_pattern( normaliseString( pattern ) ) |
| 15067 | { |
| 15068 | if( startsWith( m_pattern, '*' ) ) { |
| 15069 | m_pattern = m_pattern.substr( 1 ); |
| 15070 | m_wildcard = WildcardAtStart; |
| 15071 | } |
| 15072 | if( endsWith( m_pattern, '*' ) ) { |
| 15073 | m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); |
| 15074 | m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); |
| 15075 | } |
| 15076 | } |
| 15077 | |
| 15078 | bool WildcardPattern::matches( std::string const& str ) const { |
| 15079 | switch( m_wildcard ) { |
nothing calls this directly
no test coverage detected