Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: base/string_split.h

Issue 3284005: base: Move SplitStringUsingSubstr functions from string_util.h to string_split.h (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix base_unittests Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/string_split.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_STRING_SPLIT_H_ 5 #ifndef BASE_STRING_SPLIT_H_
6 #define BASE_STRING_SPLIT_H_ 6 #define BASE_STRING_SPLIT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/string16.h"
14
13 namespace base { 15 namespace base {
14 16
15 bool SplitStringIntoKeyValues( 17 bool SplitStringIntoKeyValues(
16 const std::string& line, 18 const std::string& line,
17 char key_value_delimiter, 19 char key_value_delimiter,
18 std::string* key, std::vector<std::string>* values); 20 std::string* key, std::vector<std::string>* values);
19 21
20 bool SplitStringIntoKeyValuePairs( 22 bool SplitStringIntoKeyValuePairs(
21 const std::string& line, 23 const std::string& line,
22 char key_value_delimiter, 24 char key_value_delimiter,
23 char key_value_pair_delimiter, 25 char key_value_pair_delimiter,
24 std::vector<std::pair<std::string, std::string> >* kv_pairs); 26 std::vector<std::pair<std::string, std::string> >* kv_pairs);
25 27
28 // The same as SplitString, but use a substring delimiter instead of a char.
29 void SplitStringUsingSubstr(const string16& str,
30 const string16& s,
31 std::vector<string16>* r);
32 void SplitStringUsingSubstr(const std::string& str,
33 const std::string& s,
34 std::vector<std::string>* r);
35
26 } // namespace base 36 } // namespace base
27 37
28 #endif // BASE_STRING_SPLIT_H 38 #endif // BASE_STRING_SPLIT_H
OLDNEW
« no previous file with comments | « no previous file | base/string_split.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698