44 if (!strcmp(
name, expectedName)) {
45 return parse<T>(
value);
51 template <
typename PropertyT>
55 if (strcmp(
name, expectedName) != 0) {
59 if (!strcmp(
value,
"inherit")) {
64 auto pr = parse<typename PropertyT::ValueT>(
value);
77 : fSelf(
self), fCurPos(
self->fCurPos) {}
81 fSelf->fCurPos = this->fCurPos;
85 void clear() { fSelf =
nullptr; }
90 RestoreCurPos(
const RestoreCurPos&) =
delete;
91 RestoreCurPos& operator=(
const RestoreCurPos&) =
delete;
95 void*
operator new(size_t) =
delete;
96 void*
operator new(size_t,
void*) =
delete;
101 template <
typename F>
102 bool advanceWhile(
F func);
104 bool matchStringToken(
const char* token,
const char** newPos =
nullptr)
const;
105 bool matchHexToken(
const char** newPos)
const;
108 bool parseEOSToken();
109 bool parseSepToken();
110 bool parseCommaWspToken();
111 bool parseExpectedStringToken(
const char*);
113 bool parseInt32Token(int32_t*);
117 bool parseNamedColorToken(
SkColor*);
118 bool parseHexColorToken(
SkColor*);
119 bool parseColorComponentScalarToken(int32_t*);
120 bool parseColorComponentIntegralToken(int32_t*);
121 bool parseColorComponentFractionalToken(int32_t*);
122 bool parseColorComponentToken(int32_t*);
123 bool parseColorToken(
SkColor*);
124 bool parseRGBColorToken(
SkColor*);
125 bool parseRGBAColorToken(
SkColor*);
132 bool parseTranslateToken(
SkMatrix*);
140 template <
typename Func,
typename T>
141 bool parseParenthesized(
const char* prefix, Func,
T*
result);
143 template <
typename T>
144 bool parseList(std::vector<T>*);
146 template <
typename T,
typename TArray>
147 bool parseEnumMap(
const TArray& arr,
T*
result) {
148 for (
size_t i = 0; i < std::size(arr); ++i) {
149 if (this->parseExpectedStringToken(std::get<0>(arr[i]))) {
150 *
result = std::get<1>(arr[i]);