Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkStringUtils.h
Go to the documentation of this file.
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
14
15#include <cstddef>
16#include <cstdint>
17
22
24
25static inline void SkAppendScalarDec(SkString* str, SkScalar value) {
27}
28
29static inline void SkAppendScalarHex(SkString* str, SkScalar value) {
31}
32
33/** Indents every non-empty line of the string by tabCnt tabs */
34SkString SkTabString(const SkString& string, int tabCnt);
35
36SkString SkStringFromUTF16(const uint16_t* src, size_t count);
37
38#if defined(SK_BUILD_FOR_WIN)
39 #define SK_strcasecmp _stricmp
40#else
41 #define SK_strcasecmp strcasecmp
42#endif
43
45 // Strictly return all results. If the input is ",," and the separator is ',' this will return
46 // an array of three empty strings.
48
49 // Only nonempty results will be added to the results. Multiple separators will be
50 // coalesced. Separators at the beginning and end of the input will be ignored. If the input is
51 // ",," and the separator is ',', this will return an empty vector.
53};
54
55// Split str on any characters in delimiters into out. (strtok with a non-destructive API.)
56void SkStrSplit(const char* str,
57 const char* delimiters,
58 SkStrSplitMode splitMode,
60
61inline void SkStrSplit(
62 const char* str, const char* delimiters, skia_private::TArray<SkString>* out) {
63 SkStrSplit(str, delimiters, kCoalesce_SkStrSplitMode, out);
64}
65
66#endif
int count
SkScalarAsStringType
@ kHex_SkScalarAsStringType
@ kDec_SkScalarAsStringType
void SkAppendScalar(SkString *, SkScalar, SkScalarAsStringType)
static void SkAppendScalarHex(SkString *str, SkScalar value)
SkString SkStringFromUTF16(const uint16_t *src, size_t count)
void SkStrSplit(const char *str, const char *delimiters, SkStrSplitMode splitMode, skia_private::TArray< SkString > *out)
SkString SkTabString(const SkString &string, int tabCnt)
SkStrSplitMode
@ kStrict_SkStrSplitMode
@ kCoalesce_SkStrSplitMode
static void SkAppendScalarDec(SkString *str, SkScalar value)
float SkScalar
Definition extension.cpp:12
uint8_t value