• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2013 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkStringUtils_DEFINED
9 #define SkStringUtils_DEFINED
10 
11 #include "SkScalar.h"
12 
13 class SkString;
14 
15 enum SkScalarAsStringType {
16     kDec_SkScalarAsStringType,
17     kHex_SkScalarAsStringType,
18 };
19 
20 void SkAppendScalar(SkString*, SkScalar, SkScalarAsStringType);
21 
SkAppendScalarDec(SkString * str,SkScalar value)22 static inline void SkAppendScalarDec(SkString* str, SkScalar value) {
23     SkAppendScalar(str, value, kDec_SkScalarAsStringType);
24 }
25 
SkAppendScalarHex(SkString * str,SkScalar value)26 static inline void SkAppendScalarHex(SkString* str, SkScalar value) {
27     SkAppendScalar(str, value, kHex_SkScalarAsStringType);
28 }
29 
30 /** Indents every non-empty line of the string by tabCnt tabs */
31 SkString SkTabString(const SkString& string, int tabCnt);
32 
33 SkString SkStringFromUTF16(const uint16_t* src, size_t count);
34 
35 #endif
36