1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/utils/SkParse.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkParse_DEFINED 1.14 +#define SkParse_DEFINED 1.15 + 1.16 +#include "SkColor.h" 1.17 + 1.18 +class SkParse { 1.19 +public: 1.20 + static int Count(const char str[]); // number of scalars or int values 1.21 + static int Count(const char str[], char separator); 1.22 + static const char* FindColor(const char str[], SkColor* value); 1.23 + static const char* FindHex(const char str[], uint32_t* value); 1.24 + static const char* FindMSec(const char str[], SkMSec* value); 1.25 + static const char* FindNamedColor(const char str[], size_t len, SkColor* color); 1.26 + static const char* FindS32(const char str[], int32_t* value); 1.27 + static const char* FindScalar(const char str[], SkScalar* value); 1.28 + static const char* FindScalars(const char str[], SkScalar value[], int count); 1.29 + 1.30 + static bool FindBool(const char str[], bool* value); 1.31 + // return the index of str in list[], or -1 if not found 1.32 + static int FindList(const char str[], const char list[]); 1.33 +#ifdef SK_SUPPORT_UNITTEST 1.34 + static void TestColor(); 1.35 + static void UnitTest(); 1.36 +#endif 1.37 +}; 1.38 + 1.39 +#endif