Lines Matching refs:str
50 static const char* skip_ws(const char str[]) in skip_ws() argument
52 SkASSERT(str); in skip_ws()
53 while (is_ws(*str)) in skip_ws()
54 str++; in skip_ws()
55 return str; in skip_ws()
58 static const char* skip_sep(const char str[]) in skip_sep() argument
60 SkASSERT(str); in skip_sep()
61 while (is_sep(*str)) in skip_sep()
62 str++; in skip_sep()
63 return str; in skip_sep()
66 int SkParse::Count(const char str[]) in Count() argument
74 if ((c = *str++) == '\0') in Count()
79 if ((c = *str++) == '\0') in Count()
87 int SkParse::Count(const char str[], char separator) in Count() argument
95 if ((c = *str++) == '\0') in Count()
100 if ((c = *str++) == '\0') in Count()
108 const char* SkParse::FindHex(const char str[], uint32_t* value) in FindHex() argument
110 SkASSERT(str); in FindHex()
111 str = skip_ws(str); in FindHex()
113 if (!is_hex(*str)) in FindHex()
120 while ((digit = to_hex(*str)) >= 0) in FindHex()
125 str += 1; in FindHex()
128 if (*str == 0 || is_ws(*str)) in FindHex()
132 return str; in FindHex()
137 const char* SkParse::FindS32(const char str[], int32_t* value) in FindS32() argument
139 SkASSERT(str); in FindS32()
140 str = skip_ws(str); in FindS32()
143 if (*str == '-') in FindS32()
146 str += 1; in FindS32()
149 if (!is_digit(*str)) in FindS32()
153 while (is_digit(*str)) in FindS32()
155 n = 10*n + *str - '0'; in FindS32()
156 str += 1; in FindS32()
160 return str; in FindS32()
163 const char* SkParse::FindMSec(const char str[], SkMSec* value) in FindMSec() argument
165 SkASSERT(str); in FindMSec()
166 str = skip_ws(str); in FindMSec()
169 if (*str == '-') in FindMSec()
172 str += 1; in FindMSec()
175 if (!is_digit(*str)) in FindMSec()
179 while (is_digit(*str)) in FindMSec()
181 n = 10*n + *str - '0'; in FindMSec()
182 str += 1; in FindMSec()
185 if (*str == '.') { in FindMSec()
186 str++; in FindMSec()
187 while (is_digit(*str)) in FindMSec()
189 n = 10*n + *str - '0'; in FindMSec()
190 str += 1; in FindMSec()
199 return str; in FindMSec()
202 const char* SkParse::FindScalar(const char str[], SkScalar* value) { in FindScalar() argument
203 SkASSERT(str); in FindScalar()
204 str = skip_ws(str); in FindScalar()
207 float v = (float)strtod(str, &stop); in FindScalar()
208 if (str == stop) { in FindScalar()
217 const char* SkParse::FindScalars(const char str[], SkScalar value[], int count) in FindScalars() argument
225 str = SkParse::FindScalar(str, value); in FindScalars()
226 if (--count == 0 || str == nullptr) in FindScalars()
230 str = skip_sep(str); in FindScalars()
235 return str; in FindScalars()
238 static bool lookup_str(const char str[], const char** table, int count) in lookup_str() argument
241 if (!strcmp(str, table[count])) in lookup_str()
246 bool SkParse::FindBool(const char str[], bool* value) in FindBool() argument
251 if (lookup_str(str, gYes, SK_ARRAY_COUNT(gYes))) in FindBool()
256 else if (lookup_str(str, gNo, SK_ARRAY_COUNT(gNo))) in FindBool()