MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / WildcardPattern

Method WildcardPattern

unittests/catch.hpp:10928–10941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10926namespace 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 ) {

Callers

nothing calls this directly

Calls 4

startsWithFunction · 0.85
endsWithFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected