#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkTo.h"
#include "include/private/base/SkTypeTraits.h"
#include <atomic>
#include <cstdarg>
#include <cstdint>
#include <cstring>
#include <string>
#include <string_view>
#include <type_traits>
Go to the source code of this file.
|
static bool | SkStrStartsWith (const char string[], const char prefixStr[]) |
|
static bool | SkStrStartsWith (const char string[], const char prefixChar) |
|
bool | SkStrEndsWith (const char string[], const char suffixStr[]) |
|
bool | SkStrEndsWith (const char string[], const char suffixChar) |
|
int | SkStrStartsWithOneOf (const char string[], const char prefixes[]) |
|
static int | SkStrFind (const char string[], const char substring[]) |
|
static int | SkStrFindLastOf (const char string[], const char subchar) |
|
static bool | SkStrContains (const char string[], const char substring[]) |
|
static bool | SkStrContains (const char string[], const char subchar) |
|
char * | SkStrAppendU32 (char buffer[], uint32_t) |
|
char * | SkStrAppendU64 (char buffer[], uint64_t, int minDigits) |
|
char * | SkStrAppendS32 (char buffer[], int32_t) |
|
char * | SkStrAppendS64 (char buffer[], int64_t, int minDigits) |
|
char * | SkStrAppendScalar (char buffer[], SkScalar) |
| Write the scalar in decimal format into buffer, and return a pointer to the next char after the last one written. More...
|
|
SkString | SkStringPrintf (const char *format,...) SK_PRINTF_LIKE(1 |
| Creates a new string and writes into it using a printf()-style format. More...
|
|
SkString static SkString | SkStringPrintf () |
| This makes it easier to write a caller as a VAR_ARGS function where the format string is optional. More...
|
|
static void | swap (SkString &a, SkString &b) |
|
◆ SkStrAppendS32()
char* SkStrAppendS32 |
( |
char |
buffer[], |
|
|
int32_t |
|
|
) |
| |
◆ SkStrAppendS64()
char* SkStrAppendS64 |
( |
char |
buffer[], |
|
|
int64_t |
, |
|
|
int |
minDigits |
|
) |
| |
◆ SkStrAppendScalar()
char* SkStrAppendScalar |
( |
char |
buffer[], |
|
|
SkScalar |
|
|
) |
| |
Write the scalar in decimal format into buffer, and return a pointer to the next char after the last one written.
Note: a terminating 0 is not written into buffer, which must be at least kSkStrAppendScalar_MaxSize. Thus if the caller wants to add a 0 at the end, buffer must be at least kSkStrAppendScalar_MaxSize + 1 bytes large.
◆ SkStrAppendU32()
char* SkStrAppendU32 |
( |
char |
buffer[], |
|
|
uint32_t |
|
|
) |
| |
◆ SkStrAppendU64()
char* SkStrAppendU64 |
( |
char |
buffer[], |
|
|
uint64_t |
, |
|
|
int |
minDigits |
|
) |
| |
◆ SkStrContains() [1/2]
static bool SkStrContains |
( |
const char |
string[], |
|
|
const char |
subchar |
|
) |
| |
|
inlinestatic |
◆ SkStrContains() [2/2]
static bool SkStrContains |
( |
const char |
string[], |
|
|
const char |
substring[] |
|
) |
| |
|
inlinestatic |
◆ SkStrEndsWith() [1/2]
bool SkStrEndsWith |
( |
const char |
string[], |
|
|
const char |
suffixChar |
|
) |
| |
◆ SkStrEndsWith() [2/2]
bool SkStrEndsWith |
( |
const char |
string[], |
|
|
const char |
suffixStr[] |
|
) |
| |
◆ SkStrFind()
static int SkStrFind |
( |
const char |
string[], |
|
|
const char |
substring[] |
|
) |
| |
|
inlinestatic |
◆ SkStrFindLastOf()
static int SkStrFindLastOf |
( |
const char |
string[], |
|
|
const char |
subchar |
|
) |
| |
|
inlinestatic |
◆ SkStringPrintf() [1/2]
This makes it easier to write a caller as a VAR_ARGS function where the format string is optional.
◆ SkStringPrintf() [2/2]
SkString SkStringPrintf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Creates a new string and writes into it using a printf()-style format.
◆ SkStrStartsWith() [1/2]
static bool SkStrStartsWith |
( |
const char |
string[], |
|
|
const char |
prefixChar |
|
) |
| |
|
inlinestatic |
◆ SkStrStartsWith() [2/2]
static bool SkStrStartsWith |
( |
const char |
string[], |
|
|
const char |
prefixStr[] |
|
) |
| |
|
inlinestatic |
◆ SkStrStartsWithOneOf()
int SkStrStartsWithOneOf |
( |
const char |
string[], |
|
|
const char |
prefixes[] |
|
) |
| |
◆ swap()
◆ kSkStrAppendS32_MaxSize
◆ kSkStrAppendS64_MaxSize
◆ kSkStrAppendScalar_MaxSize
constexpr int kSkStrAppendScalar_MaxSize = 15 |
|
staticconstexpr |
Floats have at most 8 significant digits, so we limit our g to that.
However, the total string could be 15 characters: -1.2345678e-005
In theory we should only expect up to 2 digits for the exponent, but on some platforms we have seen 3 (as in the example above).
◆ kSkStrAppendU32_MaxSize
constexpr int kSkStrAppendU32_MaxSize = 10 |
|
staticconstexpr |
◆ kSkStrAppendU64_MaxSize
constexpr int kSkStrAppendU64_MaxSize = 20 |
|
staticconstexpr |