MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / parse_header

Function parse_header

dependencies/httplib/httplib.h:3224–3251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3222
3223template <typename T>
3224inline bool parse_header(const char *beg, const char *end, T fn) {
3225 // Skip trailing spaces and tabs.
3226 while (beg < end && is_space_or_tab(end[-1])) {
3227 end--;
3228 }
3229
3230 auto p = beg;
3231 while (p < end && *p != ':') {
3232 p++;
3233 }
3234
3235 if (p == end) { return false; }
3236
3237 auto key_end = p;
3238
3239 if (*p++ != ':') { return false; }
3240
3241 while (p < end && is_space_or_tab(*p)) {
3242 p++;
3243 }
3244
3245 if (p < end) {
3246 fn(std::string(beg, key_end), decode_url(std::string(p, end), false));
3247 return true;
3248 }
3249
3250 return false;
3251}
3252
3253inline bool read_headers(Stream &strm, Headers &headers) {
3254 const auto bufsiz = 2048;

Callers 1

httplib.hFile · 0.85

Calls 2

is_space_or_tabFunction · 0.85
decode_urlFunction · 0.85

Tested by

no test coverage detected