MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / asciiStartsWith

Function asciiStartsWith

Libraries/HttpClient/HttpClientSession.cpp:69–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static bool asciiStartsWith(SC::StringSpan text, SC::StringSpan prefix)
70{
71 if (text.sizeInBytes() < prefix.sizeInBytes())
72 {
73 return false;
74 }
75 const SC::Span<const char> textBytes = text.toCharSpan();
76 const SC::Span<const char> prefixBytes = prefix.toCharSpan();
77 return ::memcmp(textBytes.data(), prefixBytes.data(), prefixBytes.sizeInBytes()) == 0;
78}
79
80static bool sessionIsAsciiWhiteSpace(char c) { return c == ' ' or c == '\t' or c == '\r' or c == '\n'; }
81

Callers 1

cookiePathMatchesFunction · 0.85

Calls 2

sizeInBytesMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected