MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / parseParams

Function parseParams

plugins/HTTPServer/HTTPServer.cpp:761–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759}
760
761void parseParams(std::map<std::string, std::vector<std::string> > &params, const std::string& text, size_t offset) {
762 std::vector<std::string> items = tokenize(text, "&", 0, false, offset);
763
764 for (size_t i = 0; i < items.size(); i++) {
765 std::string& item = items[i];
766
767 std::string key, val;
768
769 std::vector<std::string> t = tokenize(item, "=", 0, false);
770 if (t.size() > 1) {
771 key = t[0];
772 val = t[1];
773 }
774 else {
775 key = item;
776 val = "";
777 }
778
779 if (params.find(key) == params.end()) {
780 std::vector<std::string> tv;
781 params[key] = tv;
782 }
783 params[key].push_back(val);
784
785 }
786}
787
788void HTTPConnection::fillRequest(HTTPRequest& req) {
789 req.request = request;

Callers 1

fillRequestMethod · 0.85

Calls 5

tokenizeFunction · 0.50
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected