MCPcopy Create free account
hub / github.com/PABannier/bark.cpp / parse_query_text

Function parse_query_text

examples/server/httplib.h:4170–4191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4168}
4169
4170inline void parse_query_text(const std::string &s, Params &params) {
4171 std::set<std::string> cache;
4172 split(s.data(), s.data() + s.size(), '&', [&](const char *b, const char *e) {
4173 std::string kv(b, e);
4174 if (cache.find(kv) != cache.end()) { return; }
4175 cache.insert(kv);
4176
4177 std::string key;
4178 std::string val;
4179 split(b, e, '=', [&](const char *b2, const char *e2) {
4180 if (key.empty()) {
4181 key.assign(b2, e2);
4182 } else {
4183 val.assign(b2, e2);
4184 }
4185 });
4186
4187 if (!key.empty()) {
4188 params.emplace(decode_url(key, true), decode_url(val, true));
4189 }
4190 });
4191}
4192
4193inline bool parse_multipart_boundary(const std::string &content_type,
4194 std::string &boundary) {

Callers 2

parse_request_lineMethod · 0.85
read_contentMethod · 0.85

Calls 6

decode_urlFunction · 0.85
dataMethod · 0.80
endMethod · 0.80
emptyMethod · 0.80
splitFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected