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

Unified Diff: base/string_split.h

Issue 5004002: base: Move StringSplitAlongWhitespace to string_split.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unittests Created 10 years, 1 month 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/string_split.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_split.h
diff --git a/base/string_split.h b/base/string_split.h
index 6af1511c9e19339677085dcef7e67191ad396a00..9a9030a5b66d656e15c2237e58851d622396d104 100644
--- a/base/string_split.h
+++ b/base/string_split.h
@@ -69,6 +69,21 @@ void SplitStringDontTrim(const std::string& str,
char c,
std::vector<std::string>* r);
+// WARNING: this uses whitespace as defined by the HTML5 spec. If you need
+// a function similar to this but want to trim all types of whitespace, then
+// factor this out into a function that takes a string containing the characters
+// that are treated as whitespace.
+//
+// Splits the string along whitespace (where whitespace is the five space
+// characters defined by HTML 5). Each contiguous block of non-whitespace
+// characters is added to result.
+void SplitStringAlongWhitespace(const std::wstring& str,
+ std::vector<std::wstring>* result);
+void SplitStringAlongWhitespace(const string16& str,
+ std::vector<string16>* result);
+void SplitStringAlongWhitespace(const std::string& str,
+ std::vector<std::string>* result);
+
} // namespace base
#endif // BASE_STRING_SPLIT_H
« 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