OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkString_DEFINED | 10 #ifndef SkString_DEFINED |
11 #define SkString_DEFINED | 11 #define SkString_DEFINED |
12 | 12 |
13 #include "SkScalar.h" | 13 #include "SkScalar.h" |
| 14 #include "SkTArray.h" |
14 | 15 |
15 #include <stdarg.h> | 16 #include <stdarg.h> |
16 | 17 |
17 /* Some helper functions for C strings | 18 /* Some helper functions for C strings |
18 */ | 19 */ |
19 | 20 |
20 static bool SkStrStartsWith(const char string[], const char prefixStr[]) { | 21 static bool SkStrStartsWith(const char string[], const char prefixStr[]) { |
21 SkASSERT(string); | 22 SkASSERT(string); |
22 SkASSERT(prefixStr); | 23 SkASSERT(prefixStr); |
23 return !strncmp(string, prefixStr, strlen(prefixStr)); | 24 return !strncmp(string, prefixStr, strlen(prefixStr)); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 238 |
238 /// Creates a new string and writes into it using a printf()-style format. | 239 /// Creates a new string and writes into it using a printf()-style format. |
239 SkString SkStringPrintf(const char* format, ...); | 240 SkString SkStringPrintf(const char* format, ...); |
240 | 241 |
241 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is | 242 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is |
242 // declared in SkTypes.h and called by SkTSort. | 243 // declared in SkTypes.h and called by SkTSort. |
243 template <> inline void SkTSwap(SkString& a, SkString& b) { | 244 template <> inline void SkTSwap(SkString& a, SkString& b) { |
244 a.swap(b); | 245 a.swap(b); |
245 } | 246 } |
246 | 247 |
| 248 // Split str on any characters in delimiters into out. (Think, strtok with a sa
ne API.) |
| 249 void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out
); |
| 250 |
247 #endif | 251 #endif |
OLD | NEW |