| 261 | } |
| 262 | |
| 263 | std::string StringConverter::getStringParameter(const std::string &msg, const std::string &header_field, |
| 264 | const std::string &delim, const std::string ¶meter) { |
| 265 | const std::string line = StringConverter::getHeaderFieldParameter(msg, header_field); |
| 266 | if (line.empty()) { |
| 267 | return ""; |
| 268 | } |
| 269 | base::StringTokenizer tokenizer(line, delim); |
| 270 | std::string token; |
| 271 | std::string value; |
| 272 | while (tokenizer.isNextToken(token)) { |
| 273 | std::string::size_type begin = token.find(parameter); |
| 274 | if (begin != std::string::npos && begin == 0) { |
| 275 | begin += parameter.size(); |
| 276 | |
| 277 | // trim leading whitespace |
| 278 | while (std::isspace(token[begin])) ++begin; |
| 279 | |
| 280 | std::string::size_type end = token.find_first_of(delim + " \r\n", begin); |
| 281 | if (end == std::string::npos) { |
| 282 | end = token.size(); |
| 283 | } |
| 284 | // copy and trim whitespace |
| 285 | trimWhitespace(token.substr(begin, end - begin), value); |
| 286 | return value; |
| 287 | } |
| 288 | } |
| 289 | return ""; |
| 290 | } |
| 291 | |
| 292 | std::string StringConverter::getStringParameter(const std::string &msg, |
| 293 | const std::string &header_field, const std::string ¶meter) { |
nothing calls this directly
no test coverage detected