1cb93a386Sopenharmony_ci
2cb93a386Sopenharmony_ci/*
3cb93a386Sopenharmony_ci * Copyright 2006 The Android Open Source Project
4cb93a386Sopenharmony_ci *
5cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
6cb93a386Sopenharmony_ci * found in the LICENSE file.
7cb93a386Sopenharmony_ci */
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_ci#ifndef SkParse_DEFINED
11cb93a386Sopenharmony_ci#define SkParse_DEFINED
12cb93a386Sopenharmony_ci
13cb93a386Sopenharmony_ci#include "include/core/SkColor.h"
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_ciclass SK_API SkParse {
16cb93a386Sopenharmony_cipublic:
17cb93a386Sopenharmony_ci    static int Count(const char str[]); // number of scalars or int values
18cb93a386Sopenharmony_ci    static int Count(const char str[], char separator);
19cb93a386Sopenharmony_ci    static const char* FindColor(const char str[], SkColor* value);
20cb93a386Sopenharmony_ci    static const char* FindHex(const char str[], uint32_t* value);
21cb93a386Sopenharmony_ci    static const char* FindMSec(const char str[], SkMSec* value);
22cb93a386Sopenharmony_ci    static const char* FindNamedColor(const char str[], size_t len, SkColor* color);
23cb93a386Sopenharmony_ci    static const char* FindS32(const char str[], int32_t* value);
24cb93a386Sopenharmony_ci    static const char* FindScalar(const char str[], SkScalar* value);
25cb93a386Sopenharmony_ci    static const char* FindScalars(const char str[], SkScalar value[], int count);
26cb93a386Sopenharmony_ci
27cb93a386Sopenharmony_ci    static bool FindBool(const char str[], bool* value);
28cb93a386Sopenharmony_ci    // return the index of str in list[], or -1 if not found
29cb93a386Sopenharmony_ci    static int  FindList(const char str[], const char list[]);
30cb93a386Sopenharmony_ci};
31cb93a386Sopenharmony_ci
32cb93a386Sopenharmony_ci#endif
33