/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "include/utils/SkParse.h" #include "include/core/SkColor.h" #include "include/core/SkTypes.h" #include <algorithm> #include <cstddef> #include <cstdint> #include <cstring> #include <iterator> static constexpr const char* gColorNames[] = …; static constexpr struct ColorRec { … } gColors[] = …; const char* SkParse::FindNamedColor(const char* name, size_t len, SkColor* color) { … } // !!! move to char utilities //static int count_separators(const char* str, const char* sep) { // char c; // int separators = 0; // while ((c = *str++) != '\0') { // if (strchr(sep, c) == nullptr) // continue; // do { // if ((c = *str++) == '\0') // goto goHome; // } while (strchr(sep, c) != nullptr); // separators++; // } //goHome: // return separators; //} static inline unsigned nib2byte(unsigned n) { … } const char* SkParse::FindColor(const char* value, SkColor* colorPtr) { … }