michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkParse_DEFINED michael@0: #define SkParse_DEFINED michael@0: michael@0: #include "SkColor.h" michael@0: michael@0: class SkParse { michael@0: public: michael@0: static int Count(const char str[]); // number of scalars or int values michael@0: static int Count(const char str[], char separator); michael@0: static const char* FindColor(const char str[], SkColor* value); michael@0: static const char* FindHex(const char str[], uint32_t* value); michael@0: static const char* FindMSec(const char str[], SkMSec* value); michael@0: static const char* FindNamedColor(const char str[], size_t len, SkColor* color); michael@0: static const char* FindS32(const char str[], int32_t* value); michael@0: static const char* FindScalar(const char str[], SkScalar* value); michael@0: static const char* FindScalars(const char str[], SkScalar value[], int count); michael@0: michael@0: static bool FindBool(const char str[], bool* value); michael@0: // return the index of str in list[], or -1 if not found michael@0: static int FindList(const char str[], const char list[]); michael@0: #ifdef SK_SUPPORT_UNITTEST michael@0: static void TestColor(); michael@0: static void UnitTest(); michael@0: #endif michael@0: }; michael@0: michael@0: #endif