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

Function trimAsciiWhiteSpace

Libraries/HttpClient/HttpClientSession.cpp:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static SC::StringSpan trimAsciiWhiteSpace(SC::StringSpan text)
96{
97 const SC::Span<const char> bytes = text.toCharSpan();
98 size_t start = 0;
99 size_t end = bytes.sizeInBytes();
100 while (start < end and sessionIsAsciiWhiteSpace(bytes[start]))
101 {
102 start += 1;
103 }
104 while (end > start and sessionIsAsciiWhiteSpace(bytes[end - 1]))
105 {
106 end -= 1;
107 }
108 return {{bytes.data() + start, end - start}, false, SC::StringEncoding::Ascii};
109}
110
111static SC::StringSpan sliceString(SC::StringSpan text, size_t start, size_t end)
112{

Callers 1

captureSetCookieMethod · 0.70

Calls 3

sessionIsAsciiWhiteSpaceFunction · 0.85
sizeInBytesMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected