MCPcopy Create free account
hub / github.com/FastLED/FastLED / http_parser_trim

Function http_parser_trim

src/fl/stl/asio/http/http_parser.cpp.hpp:24–38  ·  view source on GitHub ↗

Helper: Trim whitespace from string

Source from the content-addressed store, hash-verified

22
23// Helper: Trim whitespace from string
24fl::string http_parser_trim(const fl::string& str) {
25 if (str.empty()) return str;
26
27 size_t start = 0;
28 while (start < str.size() && fl::isspace(str[start])) {
29 start++;
30 }
31
32 size_t end = str.size();
33 while (end > start && fl::isspace(str[end - 1])) {
34 end--;
35 }
36
37 return str.substr(start, end - start);
38}
39
40// Helper: Parse integer from string
41bool parseInt(const fl::string& str, int& out) {

Callers 1

parseHeadersMethod · 0.85

Calls 4

isspaceFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected