| 127 | |
| 128 | template<typename HayType, typename PrefixType> |
| 129 | bool IsPrefixed( |
| 130 | const HayType& hay, const PrefixType& prefix) |
| 131 | { |
| 132 | if (StringLength(hay) < StringLength(prefix)) |
| 133 | return false; |
| 134 | |
| 135 | using namespace std; |
| 136 | using namespace details; |
| 137 | |
| 138 | const auto prefixBegin = begin(prefix); |
| 139 | const auto prefixEnd = end(prefix); |
| 140 | const auto hayBegin = begin(hay); |
| 141 | |
| 142 | return std::mismatch(prefixBegin, prefixEnd, hayBegin).first == prefixEnd; |
| 143 | } |
| 144 | |
| 145 | template <typename HayType, typename PrefixType> |
| 146 | bool IsPrefixedInsensitive(const HayType& hay, const PrefixType& prefix) |
no test coverage detected