| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/string_split.h" | 5 #include "base/string_split.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 7 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 | 11 |
| 11 bool SplitStringIntoKeyValues( | 12 bool SplitStringIntoKeyValues( |
| 12 const std::string& line, | 13 const std::string& line, |
| 13 char key_value_delimiter, | 14 char key_value_delimiter, |
| 14 std::string* key, std::vector<std::string>* values) { | 15 std::string* key, std::vector<std::string>* values) { |
| 15 key->clear(); | 16 key->clear(); |
| 16 values->clear(); | 17 values->clear(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // values; just record that our split failed. | 65 // values; just record that our split failed. |
| 65 success = false; | 66 success = false; |
| 66 } | 67 } |
| 67 DCHECK_LE(value.size(), 1U); | 68 DCHECK_LE(value.size(), 1U); |
| 68 kv_pairs->push_back(make_pair(key, value.empty()? "" : value[0])); | 69 kv_pairs->push_back(make_pair(key, value.empty()? "" : value[0])); |
| 69 } | 70 } |
| 70 return success; | 71 return success; |
| 71 } | 72 } |
| 72 | 73 |
| 73 } // namespace base | 74 } // namespace base |
| OLD | NEW |