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 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 */ | 79 */ |
80 #define SkStrAppendScalar_MaxSize 15 | 80 #define SkStrAppendScalar_MaxSize 15 |
81 | 81 |
82 /** | 82 /** |
83 * Write the scaler in decimal format into buffer, and return a pointer to | 83 * Write the scaler in decimal format into buffer, and return a pointer to |
84 * the next char after the last one written. Note: a terminating 0 is not | 84 * the next char after the last one written. Note: a terminating 0 is not |
85 * written into buffer, which must be at least SkStrAppendScalar_MaxSize. | 85 * written into buffer, which must be at least SkStrAppendScalar_MaxSize. |
86 * Thus if the caller wants to add a 0 at the end, buffer must be at least | 86 * Thus if the caller wants to add a 0 at the end, buffer must be at least |
87 * SkStrAppendScalar_MaxSize + 1 bytes large. | 87 * SkStrAppendScalar_MaxSize + 1 bytes large. |
88 */ | 88 */ |
89 #ifdef SK_SCALAR_IS_FLOAT | 89 #define SkStrAppendScalar SkStrAppendFloat |
90 #define SkStrAppendScalar SkStrAppendFloat | |
91 #else | |
92 #define SkStrAppendScalar SkStrAppendFixed | |
93 #endif | |
94 | 90 |
95 char* SkStrAppendFloat(char buffer[], float); | 91 char* SkStrAppendFloat(char buffer[], float); |
96 char* SkStrAppendFixed(char buffer[], SkFixed); | 92 char* SkStrAppendFixed(char buffer[], SkFixed); |
97 | 93 |
98 /** \class SkString | 94 /** \class SkString |
99 | 95 |
100 Light weight class for managing strings. Uses reference | 96 Light weight class for managing strings. Uses reference |
101 counting to make string assignments and copies very fast | 97 counting to make string assignments and copies very fast |
102 with no extra RAM cost. Assumes UTF8 encoding. | 98 with no extra RAM cost. Assumes UTF8 encoding. |
103 */ | 99 */ |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is | 238 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is |
243 // declared in SkTypes.h and called by SkTSort. | 239 // declared in SkTypes.h and called by SkTSort. |
244 template <> inline void SkTSwap(SkString& a, SkString& b) { | 240 template <> inline void SkTSwap(SkString& a, SkString& b) { |
245 a.swap(b); | 241 a.swap(b); |
246 } | 242 } |
247 | 243 |
248 // Split str on any characters in delimiters into out. (Think, strtok with a sa
ne API.) | 244 // 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
); | 245 void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out
); |
250 | 246 |
251 #endif | 247 #endif |
OLD | NEW |