1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-04-29 12:03:53 +00:00
Catch2/src/catch2/internal/catch_wildcard_pattern.hpp
Martin Hořeňovský a822cb9717
Standardize include guard patterns to FILE_NAME_EXTENSION_INCLUDED
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.
2020-08-30 14:09:27 +02:00

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