MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / strsplit

Function strsplit

libi2pd/HTTP.cpp:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 static void strsplit(std::string_view line, std::vector<std::string_view> &tokens, char delim, std::size_t limit = 0)
57 {
58 size_t count = 1, pos;
59 while ((pos = line.find (delim)) != line.npos)
60 {
61 count++;
62 if (limit > 0 && count >= limit) delim = '\n'; // reset delimiter
63 tokens.push_back (line.substr (0, pos));
64 line = line.substr (pos + 1);
65 }
66 if (!line.empty ()) tokens.push_back (line);
67 }
68
69 static std::pair<std::string, std::string> parse_header_line(std::string_view line)
70 {

Callers 2

parse_queryMethod · 0.85
parseMethod · 0.85

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected