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

Unified Diff: base/strings/string_split.h

Issue 1291103002: Updates to StringSplit implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/strings/string_split.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_split.h
diff --git a/base/strings/string_split.h b/base/strings/string_split.h
index 3eed97458cb0bb6c6c1acdbcd422877cfd20dc9f..2a0c79561b85cca9561bbc80cf8e709e7ed2eace 100644
--- a/base/strings/string_split.h
+++ b/base/strings/string_split.h
@@ -83,7 +83,7 @@ using StringPairs = std::vector<std::pair<std::string, std::string>>;
// removes whitespace leading each key and trailing each value. Returns true
// only if each pair has a non-empty key and value. |key_value_pairs| will
// include ("","") pairs for entries without |key_value_delimiter|.
-BASE_EXPORT bool SplitStringIntoKeyValuePairs(const std::string& line,
+BASE_EXPORT bool SplitStringIntoKeyValuePairs(StringPiece input,
char key_value_delimiter,
char key_value_pair_delimiter,
StringPairs* key_value_pairs);
@@ -94,12 +94,12 @@ BASE_EXPORT bool SplitStringIntoKeyValuePairs(const std::string& line,
// TODO(brettw) this should probably be changed and expanded to provide a
// mirror of the SplitString[Piece] API above, just with the different
// delimiter handling.
-BASE_EXPORT void SplitStringUsingSubstr(const string16& str,
- const string16& s,
- std::vector<string16>* r);
-BASE_EXPORT void SplitStringUsingSubstr(const std::string& str,
- const std::string& s,
- std::vector<std::string>* r);
+BASE_EXPORT void SplitStringUsingSubstr(StringPiece16 input,
+ StringPiece16 delimiter,
+ std::vector<string16>* result);
+BASE_EXPORT void SplitStringUsingSubstr(StringPiece input,
+ StringPiece delimiter,
+ std::vector<std::string>* result);
} // namespace base
« no previous file with comments | « no previous file | base/strings/string_split.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698