MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / parse_query_text

Function parse_query_text

examples/server/httplib.h:3930–3951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3928}
3929
3930inline void parse_query_text(const std::string &s, Params &params) {
3931 std::set<std::string> cache;
3932 split(s.data(), s.data() + s.size(), '&', [&](const char *b, const char *e) {
3933 std::string kv(b, e);
3934 if (cache.find(kv) != cache.end()) { return; }
3935 cache.insert(kv);
3936
3937 std::string key;
3938 std::string val;
3939 split(b, e, '=', [&](const char *b2, const char *e2) {
3940 if (key.empty()) {
3941 key.assign(b2, e2);
3942 } else {
3943 val.assign(b2, e2);
3944 }
3945 });
3946
3947 if (!key.empty()) {
3948 params.emplace(decode_url(key, true), decode_url(val, true));
3949 }
3950 });
3951}
3952
3953inline bool parse_multipart_boundary(const std::string &content_type,
3954 std::string &boundary) {

Callers 2

parse_request_lineMethod · 0.85
read_contentMethod · 0.85

Calls 9

decode_urlFunction · 0.85
findMethod · 0.80
splitFunction · 0.70
dataMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected