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 "include/core/SkScalar.h"
12
13class SkString;
14
15enum SkScalarAsStringType {
16 kDec_SkScalarAsStringType,
17 kHex_SkScalarAsStringType,
18};
19
20void SkAppendScalar(SkString*, SkScalar, SkScalarAsStringType);
21
22static inline void SkAppendScalarDec(SkString* str, SkScalar value) {
23 SkAppendScalar(str, value, kDec_SkScalarAsStringType);
24}
25
26static 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 */
31SkString SkTabString(const SkString& string, int tabCnt);
32
33SkString SkStringFromUTF16(const uint16_t* src, size_t count);
34
35#endif
36