OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkSVGAttributeParser_DEFINED | 8 #ifndef SkSVGAttributeParser_DEFINED |
9 #define SkSVGAttributeParser_DEFINED | 9 #define SkSVGAttributeParser_DEFINED |
10 | 10 |
11 #include "SkSVGTypes.h" | 11 #include "SkSVGTypes.h" |
12 | 12 |
13 class SkSVGAttributeParser : public SkNoncopyable { | 13 class SkSVGAttributeParser : public SkNoncopyable { |
14 public: | 14 public: |
15 SkSVGAttributeParser(const char[]); | 15 SkSVGAttributeParser(const char[]); |
16 | 16 |
17 bool parseColor(SkSVGColor*); | 17 bool parseColor(SkSVGColorType*); |
18 bool parseNumber(SkSVGNumber*); | 18 bool parseNumber(SkSVGNumberType*); |
19 bool parseLength(SkSVGLength*); | 19 bool parseLength(SkSVGLength*); |
| 20 bool parseViewBox(SkSVGViewBoxType*); |
20 | 21 |
21 private: | 22 private: |
22 // Stack-only | 23 // Stack-only |
23 void* operator new(size_t) = delete; | 24 void* operator new(size_t) = delete; |
24 void* operator new(size_t, void*) = delete; | 25 void* operator new(size_t, void*) = delete; |
25 | 26 |
26 template <typename F> | 27 template <typename F> |
27 bool advanceWhile(F func); | 28 bool advanceWhile(F func); |
28 | 29 |
29 bool parseWSToken(); | 30 bool parseWSToken(); |
30 bool parseEOSToken(); | 31 bool parseEOSToken(); |
31 bool parseSepToken(); | 32 bool parseSepToken(); |
32 bool parseExpectedStringToken(const char*); | 33 bool parseExpectedStringToken(const char*); |
33 bool parseScalarToken(SkScalar*); | 34 bool parseScalarToken(SkScalar*); |
34 bool parseHexToken(uint32_t*); | 35 bool parseHexToken(uint32_t*); |
35 bool parseLengthUnitToken(SkSVGLength::Unit*); | 36 bool parseLengthUnitToken(SkSVGLength::Unit*); |
36 bool parseNamedColorToken(SkColor*); | 37 bool parseNamedColorToken(SkColor*); |
37 bool parseHexColorToken(SkColor*); | 38 bool parseHexColorToken(SkColor*); |
38 | 39 |
39 // The current position in the input string. | 40 // The current position in the input string. |
40 const char* fCurPos; | 41 const char* fCurPos; |
41 | 42 |
42 typedef SkNoncopyable INHERITED; | 43 typedef SkNoncopyable INHERITED; |
43 }; | 44 }; |
44 | 45 |
45 #endif // SkSVGAttributeParser_DEFINED | 46 #endif // SkSVGAttributeParser_DEFINED |
OLD | NEW |