File indexing completed on 2025-01-30 10:02:51
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_WILDCARD_PATTERN_HPP_INCLUDED
0009 #define CATCH_WILDCARD_PATTERN_HPP_INCLUDED
0010
0011 #include <catch2/internal/catch_case_sensitive.hpp>
0012
0013 #include <string>
0014
0015 namespace Catch
0016 {
0017 class WildcardPattern {
0018 enum WildcardPosition {
0019 NoWildcard = 0,
0020 WildcardAtStart = 1,
0021 WildcardAtEnd = 2,
0022 WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
0023 };
0024
0025 public:
0026
0027 WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity );
0028 bool matches( std::string const& str ) const;
0029
0030 private:
0031 std::string normaliseString( std::string const& str ) const;
0032 CaseSensitive m_caseSensitivity;
0033 WildcardPosition m_wildcard = NoWildcard;
0034 std::string m_pattern;
0035 };
0036 }
0037
0038 #endif