MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / trim

Function trim

app/server/multipart.cpp:17–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17std::string trim(std::string value) {
18 auto is_space = [](unsigned char ch) { return std::isspace(ch) != 0; };
19 value.erase(value.begin(), std::find_if(value.begin(), value.end(), [&](char ch) { return !is_space(ch); }));
20 value.erase(std::find_if(value.rbegin(), value.rend(), [&](char ch) { return !is_space(ch); }).base(), value.end());
21 return value;
22}
23
24// Extracts a `key="value"` or `key=value` parameter from a header value such as
25// `form-data; name="file"; filename="clip.wav"`.

Callers 3

extract_header_paramFunction · 0.70
parse_partFunction · 0.70

Calls 3

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected