Lines Matching refs:str

51 static const char* skip_ws(const char str[])  in skip_ws()  argument
53 SkASSERT(str); in skip_ws()
54 while (is_ws(*str)) in skip_ws()
55 str++; in skip_ws()
56 return str; in skip_ws()
59 static const char* skip_sep(const char str[]) in skip_sep() argument
61 SkASSERT(str); in skip_sep()
62 while (is_sep(*str)) in skip_sep()
63 str++; in skip_sep()
64 return str; in skip_sep()
67 int SkParse::Count(const char str[]) in Count() argument
75 if ((c = *str++) == '\0') in Count()
80 if ((c = *str++) == '\0') in Count()
88 int SkParse::Count(const char str[], char separator) in Count() argument
96 if ((c = *str++) == '\0') in Count()
101 if ((c = *str++) == '\0') in Count()
109 const char* SkParse::FindHex(const char str[], uint32_t* value) in FindHex() argument
111 SkASSERT(str); in FindHex()
112 str = skip_ws(str); in FindHex()
114 if (!is_hex(*str)) in FindHex()
121 while ((digit = to_hex(*str)) >= 0) in FindHex()
126 str += 1; in FindHex()
129 if (*str == 0 || is_ws(*str)) in FindHex()
133 return str; in FindHex()
138 const char* SkParse::FindS32(const char str[], int32_t* value) in FindS32() argument
140 SkASSERT(str); in FindS32()
141 str = skip_ws(str); in FindS32()
144 if (*str == '-') in FindS32()
147 str += 1; in FindS32()
150 if (!is_digit(*str)) in FindS32()
154 while (is_digit(*str)) in FindS32()
156 n = 10*n + *str - '0'; in FindS32()
157 str += 1; in FindS32()
161 return str; in FindS32()
164 const char* SkParse::FindMSec(const char str[], SkMSec* value) in FindMSec() argument
166 SkASSERT(str); in FindMSec()
167 str = skip_ws(str); in FindMSec()
170 if (*str == '-') in FindMSec()
173 str += 1; in FindMSec()
176 if (!is_digit(*str)) in FindMSec()
180 while (is_digit(*str)) in FindMSec()
182 n = 10*n + *str - '0'; in FindMSec()
183 str += 1; in FindMSec()
186 if (*str == '.') { in FindMSec()
187 str++; in FindMSec()
188 while (is_digit(*str)) in FindMSec()
190 n = 10*n + *str - '0'; in FindMSec()
191 str += 1; in FindMSec()
200 return str; in FindMSec()
203 const char* SkParse::FindScalar(const char str[], SkScalar* value) { in FindScalar() argument
204 SkASSERT(str); in FindScalar()
205 str = skip_ws(str); in FindScalar()
208 float v = (float)strtod(str, &stop); in FindScalar()
209 if (str == stop) { in FindScalar()
218 const char* SkParse::FindScalars(const char str[], SkScalar value[], int count) in FindScalars() argument
226 str = SkParse::FindScalar(str, value); in FindScalars()
227 if (--count == 0 || str == nullptr) in FindScalars()
231 str = skip_sep(str); in FindScalars()
236 return str; in FindScalars()
239 static bool lookup_str(const char str[], const char** table, int count) in lookup_str() argument
242 if (!strcmp(str, table[count])) in lookup_str()
247 bool SkParse::FindBool(const char str[], bool* value) in FindBool() argument
252 if (lookup_str(str, gYes, SK_ARRAY_COUNT(gYes))) in FindBool()
257 else if (lookup_str(str, gNo, SK_ARRAY_COUNT(gNo))) in FindBool()