MCPcopy Create free account
hub / github.com/audacity/audacity / IsPrefixed

Function IsPrefixed

libraries/lib-string-utils/StringUtils.h:129–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128template<typename HayType, typename PrefixType>
129bool 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
145template <typename HayType, typename PrefixType>
146bool IsPrefixedInsensitive(const HayType& hay, const PrefixType& prefix)

Callers 3

HandleLinkURIMethod · 0.85
IsPrefixedInsensitiveFunction · 0.85

Calls 3

StringLengthFunction · 0.85
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected