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

Function strip_trailing_newline

app/server/multipart.cpp:56–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56std::string strip_trailing_newline(std::string value) {
57 if (value.size() >= 2 && value.compare(value.size() - 2, 2, "\r\n") == 0) {
58 value.resize(value.size() - 2);
59 } else if (!value.empty() && value.back() == '\n') {
60 value.resize(value.size() - 1);
61 }
62 return value;
63}
64
65MultipartPart parse_part(const std::string & segment) {
66 MultipartPart part;

Callers 1

parse_multipart_bodyFunction · 0.85

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected