OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 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 |
| 8 #ifndef SkSVGAttributeParser_DEFINED |
| 9 #define SkSVGAttributeParser_DEFINED |
| 10 |
| 11 #include "SkSVGTypes.h" |
| 12 |
| 13 class SkSVGAttributeParser : public SkNoncopyable { |
| 14 public: |
| 15 SkSVGAttributeParser(const char[]); |
| 16 |
| 17 bool parseColor(SkSVGColor*); |
| 18 bool parseNumber(SkSVGNumber*); |
| 19 bool parseLength(SkSVGLength*); |
| 20 |
| 21 private: |
| 22 // Stack-only |
| 23 void* operator new(size_t) = delete; |
| 24 void* operator new(size_t, void*) = delete; |
| 25 |
| 26 template <typename F> |
| 27 bool advanceWhile(F func); |
| 28 |
| 29 bool parseWSToken(); |
| 30 bool parseEOSToken(); |
| 31 bool parseSepToken(); |
| 32 bool parseExpectedStringToken(const char*); |
| 33 bool parseScalarToken(SkScalar*); |
| 34 bool parseHexToken(uint32_t*); |
| 35 bool parseLengthUnitToken(SkSVGLength::Unit*); |
| 36 bool parseNamedColorToken(SkColor*); |
| 37 bool parseHexColorToken(SkColor*); |
| 38 |
| 39 // The current position in the input string. |
| 40 const char* fCurPos; |
| 41 |
| 42 typedef SkNoncopyable INHERITED; |
| 43 }; |
| 44 |
| 45 #endif // SkSVGAttributeParser_DEFINED |
OLD | NEW |