MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / getProtocol

Method getProtocol

src/StringConverter.cpp:158–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158std::string StringConverter::getProtocol(const std::string &msg) {
159 // Protocol should be in the first line
160 std::string::size_type nextline = 0;
161 const std::string line = StringConverter::getline(msg, nextline, "\r\n");
162 if (!line.empty()) {
163 const std::string::size_type begin = line.find_last_of(" ") + 1;
164 const std::string::size_type end = line.find_last_of("/");
165 if (begin != std::string::npos && end != std::string::npos) {
166 return line.substr(begin, end - begin);
167 }
168 }
169 return "";
170}
171
172std::string StringConverter::getRequestedFile(const std::string &msg) {
173 const std::string method = StringConverter::getMethod(msg);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected