mirror of
https://github.com/catchorg/Catch2.git
synced 2025-04-29 12:03:53 +00:00
This commit also strips the old copyright comment header in touched files, as those will also be replaced with a more standardized and machine-friendly version.
33 lines
876 B
C++
33 lines
876 B
C++
#ifndef CATCH_WILDCARD_PATTERN_HPP_INCLUDED
|
|
#define CATCH_WILDCARD_PATTERN_HPP_INCLUDED
|
|
|
|
#include <catch2/internal/catch_case_sensitive.hpp>
|
|
|
|
#include <string>
|
|
|
|
namespace Catch
|
|
{
|
|
class WildcardPattern {
|
|
enum WildcardPosition {
|
|
NoWildcard = 0,
|
|
WildcardAtStart = 1,
|
|
WildcardAtEnd = 2,
|
|
WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
|
|
};
|
|
|
|
public:
|
|
|
|
WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity );
|
|
virtual ~WildcardPattern() = default;
|
|
virtual bool matches( std::string const& str ) const;
|
|
|
|
private:
|
|
std::string normaliseString( std::string const& str ) const;
|
|
CaseSensitive m_caseSensitivity;
|
|
WildcardPosition m_wildcard = NoWildcard;
|
|
std::string m_pattern;
|
|
};
|
|
}
|
|
|
|
#endif // CATCH_WILDCARD_PATTERN_HPP_INCLUDED
|