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

Function splitOnce

Libraries/HttpClient/HttpClientSession.cpp:300–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300static bool splitOnce(SC::StringSpan text, char separator, SC::StringSpan& left, SC::StringSpan& right)
301{
302 const SC::Span<const char> bytes = text.toCharSpan();
303 for (size_t idx = 0; idx < bytes.sizeInBytes(); ++idx)
304 {
305 if (bytes[idx] == separator)
306 {
307 left = sliceString(text, 0, idx);
308 right = sliceString(text, idx + 1, bytes.sizeInBytes());
309 return true;
310 }
311 }
312 return false;
313}
314
315static bool sessionRequestHasHeader(const SC::HttpClientRequest& request, SC::StringSpan name)
316{

Callers 1

captureSetCookieMethod · 0.85

Calls 2

sliceStringFunction · 0.85
sizeInBytesMethod · 0.45

Tested by

no test coverage detected