| 394 | } |
| 395 | |
| 396 | std::string GetNextToken(std::string* token_list, const std::string& delimiter, size_t* pos) { |
| 397 | std::string token; |
| 398 | *pos = token_list->find(delimiter); |
| 399 | if (*pos != std::string::npos) { |
| 400 | token = token_list->substr(0, *pos); |
| 401 | } else { |
| 402 | *pos = token_list->length() - delimiter.length(); |
| 403 | token = *token_list; |
| 404 | } |
| 405 | token_list->erase(0, *pos + delimiter.length()); |
| 406 | |
| 407 | // Remove quotes from quoted strings |
| 408 | if ((token.length() > 0) && (token[0] == '\"')) { |
| 409 | token.erase(token.begin()); |
| 410 | if ((token.length() > 0) && (token[token.length() - 1] == '\"')) { |
| 411 | token.erase(--token.end()); |
| 412 | } |
| 413 | } |
| 414 | return token; |
| 415 | } |
| 416 | |
| 417 | // Given a string representation of a list of enable enum values, call the appropriate setter function |
| 418 | bool SetLocalEnableSetting(std::string list_of_enabled, const std::string& delimiter, ValidationEnabled& enabled) { |
no test coverage detected