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

Unified Diff: include/core/SkString.h

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: fix errorneous config handling Created 5 years 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
Index: include/core/SkString.h
diff --git a/include/core/SkString.h b/include/core/SkString.h
index 9229d808a63d00ab79e758d249f5cd08952daf41..3389c461d43c4524d1210ea4b813e547443d9ad2 100644
--- a/include/core/SkString.h
+++ b/include/core/SkString.h
@@ -267,7 +267,22 @@ template <> inline void SkTSwap(SkString& a, SkString& b) {
a.swap(b);
}
Kimmo Kinnunen 2015/12/07 09:26:48 Added these (copied chromium base/strings/string_s
+enum SkStrSplitResult {
scroggo 2015/12/07 13:27:52 Naming this "Result" makes me think this will be t
Kimmo Kinnunen 2015/12/08 09:07:51 Done.
+ // Strictly return all results. If the input is ",," and the separator is ',' this will return
+ // an array of three empty strings.
+ kAll_SkStrSplitResult,
scroggo 2015/12/07 13:27:52 I don't find these names to be very descriptive. B
Kimmo Kinnunen 2015/12/08 09:07:51 I changed them to your suggestions. I don't neces
+
+ // Only nonempty results will be added to the results. Multiple separators will be
+ // coalesced. Separators at the beginning and end of the input will be ignored. If the input is
+ // ",," and the separator is ',', this will return an empty vector.
+ kNonEmpty_SkStrSplitResult
+};
+
// Split str on any characters in delimiters into out. (Think, strtok with a sane API.)
-void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out);
+void SkStrSplit(const char* str, const char* delimiters, SkStrSplitResult resultBehavior,
+ SkTArray<SkString>* out);
+inline void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out) {
+ SkStrSplit(str, delimiters, kNonEmpty_SkStrSplitResult, out);
+}
#endif

Powered by Google App Engine
This is Rietveld 408576698