| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 void validate() const; | 228 void validate() const; |
| 229 #else | 229 #else |
| 230 void validate() const {} | 230 void validate() const {} |
| 231 #endif | 231 #endif |
| 232 | 232 |
| 233 static const Rec gEmptyRec; | 233 static const Rec gEmptyRec; |
| 234 static Rec* AllocRec(const char text[], size_t len); | 234 static Rec* AllocRec(const char text[], size_t len); |
| 235 static Rec* RefRec(Rec*); | 235 static Rec* RefRec(Rec*); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 class SkAutoUCS2 { | |
| 239 public: | |
| 240 SkAutoUCS2(const char utf8[]); | |
| 241 ~SkAutoUCS2(); | |
| 242 | |
| 243 /** This returns the number of ucs2 characters | |
| 244 */ | |
| 245 int count() const { return fCount; } | |
| 246 | |
| 247 /** This returns a null terminated ucs2 string | |
| 248 */ | |
| 249 const uint16_t* getUCS2() const { return fUCS2; } | |
| 250 | |
| 251 private: | |
| 252 int fCount; | |
| 253 uint16_t* fUCS2; | |
| 254 }; | |
| 255 | |
| 256 /// Creates a new string and writes into it using a printf()-style format. | 238 /// Creates a new string and writes into it using a printf()-style format. |
| 257 SkString SkStringPrintf(const char* format, ...); | 239 SkString SkStringPrintf(const char* format, ...); |
| 258 | 240 |
| 259 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is | 241 // Specialized to take advantage of SkString's fast swap path. The unspecialized
function is |
| 260 // declared in SkTypes.h and called by SkTSort. | 242 // declared in SkTypes.h and called by SkTSort. |
| 261 template <> inline void SkTSwap(SkString& a, SkString& b) { | 243 template <> inline void SkTSwap(SkString& a, SkString& b) { |
| 262 a.swap(b); | 244 a.swap(b); |
| 263 } | 245 } |
| 264 | 246 |
| 265 #endif | 247 #endif |
| OLD | NEW |