SkParse.h 1.1 KB

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