Coverage Report

Created: 2024-09-14 07:19

/src/skia/modules/svg/include/SkSVGAttributeParser.h
Line
Count
Source (jump to first uncovered line)
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 "include/core/SkColor.h"
12
#include "include/core/SkScalar.h"
13
#include "include/core/SkTypes.h"
14
#include "include/private/base/SkNoncopyable.h"
15
#include "modules/svg/include/SkSVGTypes.h"
16
17
#include "src/base/SkTLazy.h"
18
19
#include <cstdint>
20
#include <cstring>
21
#include <tuple>
22
#include <vector>
23
24
class SkMatrix;
25
class SkString;
26
27
class SkSVGAttributeParser : public SkNoncopyable {
28
public:
29
    SkSVGAttributeParser(const char[]);
30
31
    bool parseInteger(SkSVGIntegerType*);
32
    bool parseViewBox(SkSVGViewBoxType*);
33
    bool parsePreserveAspectRatio(SkSVGPreserveAspectRatio*);
34
35
    // TODO: Migrate all parse*() functions to this style (and delete the old version)
36
    //      so they can be used by parse<T>():
37
0
    bool parse(SkSVGIntegerType* v) { return parseInteger(v); }
38
39
    template <typename T> using ParseResult = SkTLazy<T>;
40
41
12.5k
    template <typename T> static ParseResult<T> parse(const char* value) {
42
12.5k
        ParseResult<T> result;
43
12.5k
        T parsedValue;
44
12.5k
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
5.03k
            result.set(std::move(parsedValue));
46
5.03k
        }
47
12.5k
        return result;
48
12.5k
    }
SkTLazy<SkSVGLength> SkSVGAttributeParser::parse<SkSVGLength>(char const*)
Line
Count
Source
41
2.62k
    template <typename T> static ParseResult<T> parse(const char* value) {
42
2.62k
        ParseResult<T> result;
43
2.62k
        T parsedValue;
44
2.62k
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
713
            result.set(std::move(parsedValue));
46
713
        }
47
2.62k
        return result;
48
2.62k
    }
SkTLazy<SkSVGObjectBoundingBoxUnits> SkSVGAttributeParser::parse<SkSVGObjectBoundingBoxUnits>(char const*)
Line
Count
Source
41
1
    template <typename T> static ParseResult<T> parse(const char* value) {
42
1
        ParseResult<T> result;
43
1
        T parsedValue;
44
1
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
0
            result.set(std::move(parsedValue));
46
0
        }
47
1
        return result;
48
1
    }
SkTLazy<SkMatrix> SkSVGAttributeParser::parse<SkMatrix>(char const*)
Line
Count
Source
41
1.06k
    template <typename T> static ParseResult<T> parse(const char* value) {
42
1.06k
        ParseResult<T> result;
43
1.06k
        T parsedValue;
44
1.06k
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
186
            result.set(std::move(parsedValue));
46
186
        }
47
1.06k
        return result;
48
1.06k
    }
Unexecuted instantiation: SkTLazy<SkSVGIRI> SkSVGAttributeParser::parse<SkSVGIRI>(char const*)
SkTLazy<SkSVGFeInputType> SkSVGAttributeParser::parse<SkSVGFeInputType>(char const*)
Line
Count
Source
41
1
    template <typename T> static ParseResult<T> parse(const char* value) {
42
1
        ParseResult<T> result;
43
1
        T parsedValue;
44
1
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
1
            result.set(std::move(parsedValue));
46
1
        }
47
1
        return result;
48
1
    }
SkTLazy<SkString> SkSVGAttributeParser::parse<SkString>(char const*)
Line
Count
Source
41
35
    template <typename T> static ParseResult<T> parse(const char* value) {
42
35
        ParseResult<T> result;
43
35
        T parsedValue;
44
35
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
35
            result.set(std::move(parsedValue));
46
35
        }
47
35
        return result;
48
35
    }
Unexecuted instantiation: SkTLazy<SkSVGFeBlend::Mode> SkSVGAttributeParser::parse<SkSVGFeBlend::Mode>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeColorMatrixType> SkSVGAttributeParser::parse<SkSVGFeColorMatrixType>(char const*)
SkTLazy<std::__1::vector<float, std::__1::allocator<float> > > SkSVGAttributeParser::parse<std::__1::vector<float, std::__1::allocator<float> > >(char const*)
Line
Count
Source
41
84
    template <typename T> static ParseResult<T> parse(const char* value) {
42
84
        ParseResult<T> result;
43
84
        T parsedValue;
44
84
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
0
            result.set(std::move(parsedValue));
46
0
        }
47
84
        return result;
48
84
    }
SkTLazy<float> SkSVGAttributeParser::parse<float>(char const*)
Line
Count
Source
41
255
    template <typename T> static ParseResult<T> parse(const char* value) {
42
255
        ParseResult<T> result;
43
255
        T parsedValue;
44
255
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
180
            result.set(std::move(parsedValue));
46
180
        }
47
255
        return result;
48
255
    }
Unexecuted instantiation: SkTLazy<SkSVGFeFuncType> SkSVGAttributeParser::parse<SkSVGFeFuncType>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeCompositeOperator> SkSVGAttributeParser::parse<SkSVGFeCompositeOperator>(char const*)
Unexecuted instantiation: SkTLazy<SkColorChannel> SkSVGAttributeParser::parse<SkColorChannel>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeGaussianBlur::StdDeviation> SkSVGAttributeParser::parse<SkSVGFeGaussianBlur::StdDeviation>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGPreserveAspectRatio> SkSVGAttributeParser::parse<SkSVGPreserveAspectRatio>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeLighting::KernelUnitLength> SkSVGAttributeParser::parse<SkSVGFeLighting::KernelUnitLength>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeMorphology::Operator> SkSVGAttributeParser::parse<SkSVGFeMorphology::Operator>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeMorphology::Radius> SkSVGAttributeParser::parse<SkSVGFeMorphology::Radius>(char const*)
Unexecuted instantiation: SkTLazy<int> SkSVGAttributeParser::parse<int>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeTurbulenceBaseFrequency> SkSVGAttributeParser::parse<SkSVGFeTurbulenceBaseFrequency>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeTurbulenceType> SkSVGAttributeParser::parse<SkSVGFeTurbulenceType>(char const*)
SkTLazy<SkSVGFuncIRI> SkSVGAttributeParser::parse<SkSVGFuncIRI>(char const*)
Line
Count
Source
41
1.18k
    template <typename T> static ParseResult<T> parse(const char* value) {
42
1.18k
        ParseResult<T> result;
43
1.18k
        T parsedValue;
44
1.18k
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
1.15k
            result.set(std::move(parsedValue));
46
1.15k
        }
47
1.18k
        return result;
48
1.18k
    }
SkTLazy<SkSVGFillRule> SkSVGAttributeParser::parse<SkSVGFillRule>(char const*)
Line
Count
Source
41
243
    template <typename T> static ParseResult<T> parse(const char* value) {
42
243
        ParseResult<T> result;
43
243
        T parsedValue;
44
243
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
0
            result.set(std::move(parsedValue));
46
0
        }
47
243
        return result;
48
243
    }
SkTLazy<unsigned int> SkSVGAttributeParser::parse<unsigned int>(char const*)
Line
Count
Source
41
318
    template <typename T> static ParseResult<T> parse(const char* value) {
42
318
        ParseResult<T> result;
43
318
        T parsedValue;
44
318
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
0
            result.set(std::move(parsedValue));
46
0
        }
47
318
        return result;
48
318
    }
Unexecuted instantiation: SkTLazy<SkSVGColorspace> SkSVGAttributeParser::parse<SkSVGColorspace>(char const*)
SkTLazy<SkSVGDisplay> SkSVGAttributeParser::parse<SkSVGDisplay>(char const*)
Line
Count
Source
41
37
    template <typename T> static ParseResult<T> parse(const char* value) {
42
37
        ParseResult<T> result;
43
37
        T parsedValue;
44
37
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
10
            result.set(std::move(parsedValue));
46
10
        }
47
37
        return result;
48
37
    }
SkTLazy<SkSVGPaint> SkSVGAttributeParser::parse<SkSVGPaint>(char const*)
Line
Count
Source
41
774
    template <typename T> static ParseResult<T> parse(const char* value) {
42
774
        ParseResult<T> result;
43
774
        T parsedValue;
44
774
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
596
            result.set(std::move(parsedValue));
46
596
        }
47
774
        return result;
48
774
    }
SkTLazy<SkSVGColor> SkSVGAttributeParser::parse<SkSVGColor>(char const*)
Line
Count
Source
41
42
    template <typename T> static ParseResult<T> parse(const char* value) {
42
42
        ParseResult<T> result;
43
42
        T parsedValue;
44
42
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
5
            result.set(std::move(parsedValue));
46
5
        }
47
42
        return result;
48
42
    }
SkTLazy<SkSVGFontFamily> SkSVGAttributeParser::parse<SkSVGFontFamily>(char const*)
Line
Count
Source
41
59
    template <typename T> static ParseResult<T> parse(const char* value) {
42
59
        ParseResult<T> result;
43
59
        T parsedValue;
44
59
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
59
            result.set(std::move(parsedValue));
46
59
        }
47
59
        return result;
48
59
    }
Unexecuted instantiation: SkTLazy<SkSVGFontSize> SkSVGAttributeParser::parse<SkSVGFontSize>(char const*)
SkTLazy<SkSVGFontStyle> SkSVGAttributeParser::parse<SkSVGFontStyle>(char const*)
Line
Count
Source
41
219
    template <typename T> static ParseResult<T> parse(const char* value) {
42
219
        ParseResult<T> result;
43
219
        T parsedValue;
44
219
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
0
            result.set(std::move(parsedValue));
46
0
        }
47
219
        return result;
48
219
    }
SkTLazy<SkSVGFontWeight> SkSVGAttributeParser::parse<SkSVGFontWeight>(char const*)
Line
Count
Source
41
47
    template <typename T> static ParseResult<T> parse(const char* value) {
42
47
        ParseResult<T> result;
43
47
        T parsedValue;
44
47
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
47
            result.set(std::move(parsedValue));
46
47
        }
47
47
        return result;
48
47
    }
SkTLazy<SkSVGDashArray> SkSVGAttributeParser::parse<SkSVGDashArray>(char const*)
Line
Count
Source
41
244
    template <typename T> static ParseResult<T> parse(const char* value) {
42
244
        ParseResult<T> result;
43
244
        T parsedValue;
44
244
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
146
            result.set(std::move(parsedValue));
46
146
        }
47
244
        return result;
48
244
    }
SkTLazy<SkSVGLineCap> SkSVGAttributeParser::parse<SkSVGLineCap>(char const*)
Line
Count
Source
41
52
    template <typename T> static ParseResult<T> parse(const char* value) {
42
52
        ParseResult<T> result;
43
52
        T parsedValue;
44
52
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
6
            result.set(std::move(parsedValue));
46
6
        }
47
52
        return result;
48
52
    }
SkTLazy<SkSVGLineJoin> SkSVGAttributeParser::parse<SkSVGLineJoin>(char const*)
Line
Count
Source
41
58
    template <typename T> static ParseResult<T> parse(const char* value) {
42
58
        ParseResult<T> result;
43
58
        T parsedValue;
44
58
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
42
            result.set(std::move(parsedValue));
46
42
        }
47
58
        return result;
48
58
    }
Unexecuted instantiation: SkTLazy<SkSVGTextAnchor> SkSVGAttributeParser::parse<SkSVGTextAnchor>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGVisibility> SkSVGAttributeParser::parse<SkSVGVisibility>(char const*)
SkTLazy<SkPath> SkSVGAttributeParser::parse<SkPath>(char const*)
Line
Count
Source
41
4.63k
    template <typename T> static ParseResult<T> parse(const char* value) {
42
4.63k
        ParseResult<T> result;
43
4.63k
        T parsedValue;
44
4.63k
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
1.60k
            result.set(std::move(parsedValue));
46
1.60k
        }
47
4.63k
        return result;
48
4.63k
    }
SkTLazy<std::__1::vector<SkPoint, std::__1::allocator<SkPoint> > > SkSVGAttributeParser::parse<std::__1::vector<SkPoint, std::__1::allocator<SkPoint> > >(char const*)
Line
Count
Source
41
202
    template <typename T> static ParseResult<T> parse(const char* value) {
42
202
        ParseResult<T> result;
43
202
        T parsedValue;
44
202
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
16
            result.set(std::move(parsedValue));
46
16
        }
47
202
        return result;
48
202
    }
SkTLazy<std::__1::vector<SkSVGLength, std::__1::allocator<SkSVGLength> > > SkSVGAttributeParser::parse<std::__1::vector<SkSVGLength, std::__1::allocator<SkSVGLength> > >(char const*)
Line
Count
Source
41
328
    template <typename T> static ParseResult<T> parse(const char* value) {
42
328
        ParseResult<T> result;
43
328
        T parsedValue;
44
328
        if (SkSVGAttributeParser(value).parse(&parsedValue)) {
45
227
            result.set(std::move(parsedValue));
46
227
        }
47
328
        return result;
48
328
    }
Unexecuted instantiation: SkTLazy<SkSVGXmlSpace> SkSVGAttributeParser::parse<SkSVGXmlSpace>(char const*)
Unexecuted instantiation: SkTLazy<SkSVGSpreadMethod> SkSVGAttributeParser::parse<SkSVGSpreadMethod>(char const*)
49
50
    template <typename T>
51
    static ParseResult<T> parse(const char* expectedName,
52
                                const char* name,
53
38.8k
                                const char* value) {
54
38.8k
        if (!strcmp(name, expectedName)) {
55
6.46k
            return parse<T>(value);
56
6.46k
        }
57
58
32.3k
        return ParseResult<T>();
59
38.8k
    }
SkTLazy<SkSVGLength> SkSVGAttributeParser::parse<SkSVGLength>(char const*, char const*, char const*)
Line
Count
Source
53
15.2k
                                const char* value) {
54
15.2k
        if (!strcmp(name, expectedName)) {
55
1.17k
            return parse<T>(value);
56
1.17k
        }
57
58
14.0k
        return ParseResult<T>();
59
15.2k
    }
SkTLazy<SkSVGFeInputType> SkSVGAttributeParser::parse<SkSVGFeInputType>(char const*, char const*, char const*)
Line
Count
Source
53
760
                                const char* value) {
54
760
        if (!strcmp(name, expectedName)) {
55
1
            return parse<T>(value);
56
1
        }
57
58
759
        return ParseResult<T>();
59
760
    }
SkTLazy<SkString> SkSVGAttributeParser::parse<SkString>(char const*, char const*, char const*)
Line
Count
Source
53
757
                                const char* value) {
54
757
        if (!strcmp(name, expectedName)) {
55
35
            return parse<T>(value);
56
35
        }
57
58
722
        return ParseResult<T>();
59
757
    }
Unexecuted instantiation: SkTLazy<SkSVGFeBlend::Mode> SkSVGAttributeParser::parse<SkSVGFeBlend::Mode>(char const*, char const*, char const*)
SkTLazy<SkSVGFeColorMatrixType> SkSVGAttributeParser::parse<SkSVGFeColorMatrixType>(char const*, char const*, char const*)
Line
Count
Source
53
674
                                const char* value) {
54
674
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
674
        return ParseResult<T>();
59
674
    }
SkTLazy<std::__1::vector<float, std::__1::allocator<float> > > SkSVGAttributeParser::parse<std::__1::vector<float, std::__1::allocator<float> > >(char const*, char const*, char const*)
Line
Count
Source
53
2.45k
                                const char* value) {
54
2.45k
        if (!strcmp(name, expectedName)) {
55
84
            return parse<T>(value);
56
84
        }
57
58
2.37k
        return ParseResult<T>();
59
2.45k
    }
SkTLazy<float> SkSVGAttributeParser::parse<float>(char const*, char const*, char const*)
Line
Count
Source
53
8
                                const char* value) {
54
8
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
8
        return ParseResult<T>();
59
8
    }
Unexecuted instantiation: SkTLazy<SkSVGFeFuncType> SkSVGAttributeParser::parse<SkSVGFeFuncType>(char const*, char const*, char const*)
SkTLazy<SkSVGFeCompositeOperator> SkSVGAttributeParser::parse<SkSVGFeCompositeOperator>(char const*, char const*, char const*)
Line
Count
Source
53
2
                                const char* value) {
54
2
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
2
        return ParseResult<T>();
59
2
    }
Unexecuted instantiation: SkTLazy<SkColorChannel> SkSVGAttributeParser::parse<SkColorChannel>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeGaussianBlur::StdDeviation> SkSVGAttributeParser::parse<SkSVGFeGaussianBlur::StdDeviation>(char const*, char const*, char const*)
SkTLazy<SkSVGIRI> SkSVGAttributeParser::parse<SkSVGIRI>(char const*, char const*, char const*)
Line
Count
Source
53
378
                                const char* value) {
54
378
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
378
        return ParseResult<T>();
59
378
    }
SkTLazy<SkSVGPreserveAspectRatio> SkSVGAttributeParser::parse<SkSVGPreserveAspectRatio>(char const*, char const*, char const*)
Line
Count
Source
53
72
                                const char* value) {
54
72
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
72
        return ParseResult<T>();
59
72
    }
Unexecuted instantiation: SkTLazy<SkSVGFeLighting::KernelUnitLength> SkSVGAttributeParser::parse<SkSVGFeLighting::KernelUnitLength>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeMorphology::Operator> SkSVGAttributeParser::parse<SkSVGFeMorphology::Operator>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeMorphology::Radius> SkSVGAttributeParser::parse<SkSVGFeMorphology::Radius>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<int> SkSVGAttributeParser::parse<int>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeTurbulenceBaseFrequency> SkSVGAttributeParser::parse<SkSVGFeTurbulenceBaseFrequency>(char const*, char const*, char const*)
Unexecuted instantiation: SkTLazy<SkSVGFeTurbulenceType> SkSVGAttributeParser::parse<SkSVGFeTurbulenceType>(char const*, char const*, char const*)
SkTLazy<SkSVGObjectBoundingBoxUnits> SkSVGAttributeParser::parse<SkSVGObjectBoundingBoxUnits>(char const*, char const*, char const*)
Line
Count
Source
53
2.78k
                                const char* value) {
54
2.78k
        if (!strcmp(name, expectedName)) {
55
1
            return parse<T>(value);
56
1
        }
57
58
2.77k
        return ParseResult<T>();
59
2.78k
    }
SkTLazy<SkPath> SkSVGAttributeParser::parse<SkPath>(char const*, char const*, char const*)
Line
Count
Source
53
5.62k
                                const char* value) {
54
5.62k
        if (!strcmp(name, expectedName)) {
55
4.63k
            return parse<T>(value);
56
4.63k
        }
57
58
989
        return ParseResult<T>();
59
5.62k
    }
SkTLazy<SkMatrix> SkSVGAttributeParser::parse<SkMatrix>(char const*, char const*, char const*)
Line
Count
Source
53
184
                                const char* value) {
54
184
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
184
        return ParseResult<T>();
59
184
    }
SkTLazy<std::__1::vector<SkPoint, std::__1::allocator<SkPoint> > > SkSVGAttributeParser::parse<std::__1::vector<SkPoint, std::__1::allocator<SkPoint> > >(char const*, char const*, char const*)
Line
Count
Source
53
210
                                const char* value) {
54
210
        if (!strcmp(name, expectedName)) {
55
202
            return parse<T>(value);
56
202
        }
57
58
8
        return ParseResult<T>();
59
210
    }
SkTLazy<std::__1::vector<SkSVGLength, std::__1::allocator<SkSVGLength> > > SkSVGAttributeParser::parse<std::__1::vector<SkSVGLength, std::__1::allocator<SkSVGLength> > >(char const*, char const*, char const*)
Line
Count
Source
53
7.72k
                                const char* value) {
54
7.72k
        if (!strcmp(name, expectedName)) {
55
328
            return parse<T>(value);
56
328
        }
57
58
7.40k
        return ParseResult<T>();
59
7.72k
    }
SkTLazy<SkSVGXmlSpace> SkSVGAttributeParser::parse<SkSVGXmlSpace>(char const*, char const*, char const*)
Line
Count
Source
53
1.78k
                                const char* value) {
54
1.78k
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
1.78k
        return ParseResult<T>();
59
1.78k
    }
SkTLazy<SkSVGSpreadMethod> SkSVGAttributeParser::parse<SkSVGSpreadMethod>(char const*, char const*, char const*)
Line
Count
Source
53
184
                                const char* value) {
54
184
        if (!strcmp(name, expectedName)) {
55
0
            return parse<T>(value);
56
0
        }
57
58
184
        return ParseResult<T>();
59
184
    }
60
61
    template <typename PropertyT>
62
    static ParseResult<PropertyT> parseProperty(const char* expectedName,
63
                                                const char* name,
64
442k
                                                const char* value) {
65
442k
        if (strcmp(name, expectedName) != 0) {
66
438k
            return ParseResult<PropertyT>();
67
438k
        }
68
69
3.70k
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
3.70k
        auto pr = parse<typename PropertyT::ValueT>(value);
75
3.70k
        if (pr.isValid()) {
76
2.33k
            PropertyT result(*pr);
77
2.33k
            return ParseResult<PropertyT>(&result);
78
2.33k
        }
79
80
1.36k
        return ParseResult<PropertyT>();
81
3.70k
    }
SkTLazy<SkSVGProperty<SkSVGFuncIRI, false> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFuncIRI, false> >(char const*, char const*, char const*)
Line
Count
Source
64
44.4k
                                                const char* value) {
65
44.4k
        if (strcmp(name, expectedName) != 0) {
66
43.2k
            return ParseResult<PropertyT>();
67
43.2k
        }
68
69
1.18k
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
1.18k
        auto pr = parse<typename PropertyT::ValueT>(value);
75
1.18k
        if (pr.isValid()) {
76
1.15k
            PropertyT result(*pr);
77
1.15k
            return ParseResult<PropertyT>(&result);
78
1.15k
        }
79
80
28
        return ParseResult<PropertyT>();
81
1.18k
    }
SkTLazy<SkSVGProperty<SkSVGFillRule, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFillRule, true> >(char const*, char const*, char const*)
Line
Count
Source
64
29.0k
                                                const char* value) {
65
29.0k
        if (strcmp(name, expectedName) != 0) {
66
28.8k
            return ParseResult<PropertyT>();
67
28.8k
        }
68
69
243
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
243
        auto pr = parse<typename PropertyT::ValueT>(value);
75
243
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
243
        return ParseResult<PropertyT>();
81
243
    }
SkTLazy<SkSVGProperty<unsigned int, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<unsigned int, true> >(char const*, char const*, char const*)
Line
Count
Source
64
14.7k
                                                const char* value) {
65
14.7k
        if (strcmp(name, expectedName) != 0) {
66
14.4k
            return ParseResult<PropertyT>();
67
14.4k
        }
68
69
318
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
318
        auto pr = parse<typename PropertyT::ValueT>(value);
75
318
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
318
        return ParseResult<PropertyT>();
81
318
    }
SkTLazy<SkSVGProperty<SkSVGColorspace, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGColorspace, true> >(char const*, char const*, char const*)
Line
Count
Source
64
29.5k
                                                const char* value) {
65
29.5k
        if (strcmp(name, expectedName) != 0) {
66
29.5k
            return ParseResult<PropertyT>();
67
29.5k
        }
68
69
0
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
0
        auto pr = parse<typename PropertyT::ValueT>(value);
75
0
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
0
        return ParseResult<PropertyT>();
81
0
    }
SkTLazy<SkSVGProperty<SkSVGDisplay, false> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGDisplay, false> >(char const*, char const*, char const*)
Line
Count
Source
64
14.7k
                                                const char* value) {
65
14.7k
        if (strcmp(name, expectedName) != 0) {
66
14.7k
            return ParseResult<PropertyT>();
67
14.7k
        }
68
69
37
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
37
        auto pr = parse<typename PropertyT::ValueT>(value);
75
37
        if (pr.isValid()) {
76
10
            PropertyT result(*pr);
77
10
            return ParseResult<PropertyT>(&result);
78
10
        }
79
80
27
        return ParseResult<PropertyT>();
81
37
    }
SkTLazy<SkSVGProperty<SkSVGPaint, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGPaint, true> >(char const*, char const*, char const*)
Line
Count
Source
64
28.9k
                                                const char* value) {
65
28.9k
        if (strcmp(name, expectedName) != 0) {
66
28.1k
            return ParseResult<PropertyT>();
67
28.1k
        }
68
69
774
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
774
        auto pr = parse<typename PropertyT::ValueT>(value);
75
774
        if (pr.isValid()) {
76
596
            PropertyT result(*pr);
77
596
            return ParseResult<PropertyT>(&result);
78
596
        }
79
80
178
        return ParseResult<PropertyT>();
81
774
    }
SkTLazy<SkSVGProperty<float, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<float, true> >(char const*, char const*, char const*)
Line
Count
Source
64
41.8k
                                                const char* value) {
65
41.8k
        if (strcmp(name, expectedName) != 0) {
66
41.6k
            return ParseResult<PropertyT>();
67
41.6k
        }
68
69
175
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
175
        auto pr = parse<typename PropertyT::ValueT>(value);
75
175
        if (pr.isValid()) {
76
148
            PropertyT result(*pr);
77
148
            return ParseResult<PropertyT>(&result);
78
148
        }
79
80
27
        return ParseResult<PropertyT>();
81
175
    }
SkTLazy<SkSVGProperty<SkSVGColor, false> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGColor, false> >(char const*, char const*, char const*)
Line
Count
Source
64
42.7k
                                                const char* value) {
65
42.7k
        if (strcmp(name, expectedName) != 0) {
66
42.7k
            return ParseResult<PropertyT>();
67
42.7k
        }
68
69
42
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
42
        auto pr = parse<typename PropertyT::ValueT>(value);
75
42
        if (pr.isValid()) {
76
5
            PropertyT result(*pr);
77
5
            return ParseResult<PropertyT>(&result);
78
5
        }
79
80
37
        return ParseResult<PropertyT>();
81
42
    }
SkTLazy<SkSVGProperty<float, false> > SkSVGAttributeParser::parseProperty<SkSVGProperty<float, false> >(char const*, char const*, char const*)
Line
Count
Source
64
42.7k
                                                const char* value) {
65
42.7k
        if (strcmp(name, expectedName) != 0) {
66
42.6k
            return ParseResult<PropertyT>();
67
42.6k
        }
68
69
80
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
80
        auto pr = parse<typename PropertyT::ValueT>(value);
75
80
        if (pr.isValid()) {
76
32
            PropertyT result(*pr);
77
32
            return ParseResult<PropertyT>(&result);
78
32
        }
79
80
48
        return ParseResult<PropertyT>();
81
80
    }
SkTLazy<SkSVGProperty<SkSVGFontFamily, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFontFamily, true> >(char const*, char const*, char const*)
Line
Count
Source
64
14.3k
                                                const char* value) {
65
14.3k
        if (strcmp(name, expectedName) != 0) {
66
14.2k
            return ParseResult<PropertyT>();
67
14.2k
        }
68
69
59
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
59
        auto pr = parse<typename PropertyT::ValueT>(value);
75
59
        if (pr.isValid()) {
76
59
            PropertyT result(*pr);
77
59
            return ParseResult<PropertyT>(&result);
78
59
        }
79
80
0
        return ParseResult<PropertyT>();
81
59
    }
SkTLazy<SkSVGProperty<SkSVGFontSize, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFontSize, true> >(char const*, char const*, char const*)
Line
Count
Source
64
14.2k
                                                const char* value) {
65
14.2k
        if (strcmp(name, expectedName) != 0) {
66
14.2k
            return ParseResult<PropertyT>();
67
14.2k
        }
68
69
0
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
0
        auto pr = parse<typename PropertyT::ValueT>(value);
75
0
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
0
        return ParseResult<PropertyT>();
81
0
    }
SkTLazy<SkSVGProperty<SkSVGFontStyle, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFontStyle, true> >(char const*, char const*, char const*)
Line
Count
Source
64
14.2k
                                                const char* value) {
65
14.2k
        if (strcmp(name, expectedName) != 0) {
66
14.0k
            return ParseResult<PropertyT>();
67
14.0k
        }
68
69
219
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
219
        auto pr = parse<typename PropertyT::ValueT>(value);
75
219
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
219
        return ParseResult<PropertyT>();
81
219
    }
SkTLazy<SkSVGProperty<SkSVGFontWeight, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGFontWeight, true> >(char const*, char const*, char const*)
Line
Count
Source
64
14.2k
                                                const char* value) {
65
14.2k
        if (strcmp(name, expectedName) != 0) {
66
14.2k
            return ParseResult<PropertyT>();
67
14.2k
        }
68
69
47
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
47
        auto pr = parse<typename PropertyT::ValueT>(value);
75
47
        if (pr.isValid()) {
76
47
            PropertyT result(*pr);
77
47
            return ParseResult<PropertyT>(&result);
78
47
        }
79
80
0
        return ParseResult<PropertyT>();
81
47
    }
SkTLazy<SkSVGProperty<SkSVGDashArray, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGDashArray, true> >(char const*, char const*, char const*)
Line
Count
Source
64
13.9k
                                                const char* value) {
65
13.9k
        if (strcmp(name, expectedName) != 0) {
66
13.7k
            return ParseResult<PropertyT>();
67
13.7k
        }
68
69
244
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
244
        auto pr = parse<typename PropertyT::ValueT>(value);
75
244
        if (pr.isValid()) {
76
146
            PropertyT result(*pr);
77
146
            return ParseResult<PropertyT>(&result);
78
146
        }
79
80
98
        return ParseResult<PropertyT>();
81
244
    }
SkTLazy<SkSVGProperty<SkSVGLength, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGLength, true> >(char const*, char const*, char const*)
Line
Count
Source
64
27.4k
                                                const char* value) {
65
27.4k
        if (strcmp(name, expectedName) != 0) {
66
27.3k
            return ParseResult<PropertyT>();
67
27.3k
        }
68
69
167
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
167
        auto pr = parse<typename PropertyT::ValueT>(value);
75
167
        if (pr.isValid()) {
76
89
            PropertyT result(*pr);
77
89
            return ParseResult<PropertyT>(&result);
78
89
        }
79
80
78
        return ParseResult<PropertyT>();
81
167
    }
SkTLazy<SkSVGProperty<SkSVGLineCap, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGLineCap, true> >(char const*, char const*, char const*)
Line
Count
Source
64
13.8k
                                                const char* value) {
65
13.8k
        if (strcmp(name, expectedName) != 0) {
66
13.7k
            return ParseResult<PropertyT>();
67
13.7k
        }
68
69
52
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
52
        auto pr = parse<typename PropertyT::ValueT>(value);
75
52
        if (pr.isValid()) {
76
6
            PropertyT result(*pr);
77
6
            return ParseResult<PropertyT>(&result);
78
6
        }
79
80
46
        return ParseResult<PropertyT>();
81
52
    }
SkTLazy<SkSVGProperty<SkSVGLineJoin, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGLineJoin, true> >(char const*, char const*, char const*)
Line
Count
Source
64
13.8k
                                                const char* value) {
65
13.8k
        if (strcmp(name, expectedName) != 0) {
66
13.7k
            return ParseResult<PropertyT>();
67
13.7k
        }
68
69
58
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
58
        auto pr = parse<typename PropertyT::ValueT>(value);
75
58
        if (pr.isValid()) {
76
42
            PropertyT result(*pr);
77
42
            return ParseResult<PropertyT>(&result);
78
42
        }
79
80
16
        return ParseResult<PropertyT>();
81
58
    }
SkTLazy<SkSVGProperty<SkSVGTextAnchor, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGTextAnchor, true> >(char const*, char const*, char const*)
Line
Count
Source
64
13.5k
                                                const char* value) {
65
13.5k
        if (strcmp(name, expectedName) != 0) {
66
13.5k
            return ParseResult<PropertyT>();
67
13.5k
        }
68
69
0
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
0
        auto pr = parse<typename PropertyT::ValueT>(value);
75
0
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
0
        return ParseResult<PropertyT>();
81
0
    }
SkTLazy<SkSVGProperty<SkSVGVisibility, true> > SkSVGAttributeParser::parseProperty<SkSVGProperty<SkSVGVisibility, true> >(char const*, char const*, char const*)
Line
Count
Source
64
13.5k
                                                const char* value) {
65
13.5k
        if (strcmp(name, expectedName) != 0) {
66
13.5k
            return ParseResult<PropertyT>();
67
13.5k
        }
68
69
0
        if (!strcmp(value, "inherit")) {
70
0
            PropertyT result(SkSVGPropertyState::kInherit);
71
0
            return ParseResult<PropertyT>(&result);
72
0
        }
73
74
0
        auto pr = parse<typename PropertyT::ValueT>(value);
75
0
        if (pr.isValid()) {
76
0
            PropertyT result(*pr);
77
0
            return ParseResult<PropertyT>(&result);
78
0
        }
79
80
0
        return ParseResult<PropertyT>();
81
0
    }
82
83
private:
84
    class RestoreCurPos {
85
    public:
86
        explicit RestoreCurPos(SkSVGAttributeParser* self)
87
13.7k
            : fSelf(self), fCurPos(self->fCurPos) {}
88
89
13.7k
        ~RestoreCurPos() {
90
13.7k
            if (fSelf) {
91
11.3k
                fSelf->fCurPos = this->fCurPos;
92
11.3k
            }
93
13.7k
        }
94
95
2.44k
        void clear() { fSelf = nullptr; }
96
    private:
97
        SkSVGAttributeParser* fSelf;
98
        const char* fCurPos;
99
100
        RestoreCurPos(           const RestoreCurPos&) = delete;
101
        RestoreCurPos& operator=(const RestoreCurPos&) = delete;
102
    };
103
104
    // Stack-only
105
    void* operator new(size_t) = delete;
106
    void* operator new(size_t, void*) = delete;
107
108
    template <typename T>
109
    bool parse(T*);
110
111
    template <typename F>
112
    bool advanceWhile(F func);
113
114
    bool matchStringToken(const char* token, const char** newPos = nullptr) const;
115
    bool matchHexToken(const char** newPos) const;
116
117
    bool parseWSToken();
118
    bool parseEOSToken();
119
    bool parseSepToken();
120
    bool parseCommaWspToken();
121
    bool parseExpectedStringToken(const char*);
122
    bool parseScalarToken(SkScalar*);
123
    bool parseInt32Token(int32_t*);
124
    bool parseEscape(SkUnichar*);
125
    bool parseIdentToken(SkString*);
126
    bool parseLengthUnitToken(SkSVGLength::Unit*);
127
    bool parseNamedColorToken(SkColor*);
128
    bool parseHexColorToken(SkColor*);
129
    bool parseColorComponentScalarToken(int32_t*);
130
    bool parseColorComponentIntegralToken(int32_t*);
131
    bool parseColorComponentFractionalToken(int32_t*);
132
    bool parseColorComponentToken(int32_t*);
133
    bool parseColorToken(SkColor*);
134
    bool parseRGBColorToken(SkColor*);
135
    bool parseRGBAColorToken(SkColor*);
136
    bool parseSVGColor(SkSVGColor*, SkSVGColor::Vars&&);
137
    bool parseSVGColorType(SkSVGColorType*);
138
    bool parseFuncIRI(SkSVGFuncIRI*);
139
140
    // Transform helpers
141
    bool parseMatrixToken(SkMatrix*);
142
    bool parseTranslateToken(SkMatrix*);
143
    bool parseScaleToken(SkMatrix*);
144
    bool parseRotateToken(SkMatrix*);
145
    bool parseSkewXToken(SkMatrix*);
146
    bool parseSkewYToken(SkMatrix*);
147
148
    // Parses a sequence of 'WS* <prefix> WS* (<nested>)', where the nested sequence
149
    // is handled by the passed functor.
150
    template <typename Func, typename T>
151
    bool parseParenthesized(const char* prefix, Func, T* result);
152
153
    template <typename T>
154
    bool parseList(std::vector<T>*);
155
156
    template <typename T, typename TArray>
157
267
    bool parseEnumMap(const TArray& arr, T* result) {
158
1.18k
        for (size_t i = 0; i < std::size(arr); ++i) {
159
961
            if (this->parseExpectedStringToken(std::get<0>(arr[i]))) {
160
47
                *result = std::get<1>(arr[i]);
161
47
                return true;
162
47
            }
163
961
        }
164
220
        return false;
165
267
    }
bool SkSVGAttributeParser::parseEnumMap<SkSVGFeInputType::Type, std::__1::tuple<char const*, SkSVGFeInputType::Type> [6]>(std::__1::tuple<char const*, SkSVGFeInputType::Type> const (&) [6], SkSVGFeInputType::Type*)
Line
Count
Source
157
1
    bool parseEnumMap(const TArray& arr, T* result) {
158
7
        for (size_t i = 0; i < std::size(arr); ++i) {
159
6
            if (this->parseExpectedStringToken(std::get<0>(arr[i]))) {
160
0
                *result = std::get<1>(arr[i]);
161
0
                return true;
162
0
            }
163
6
        }
164
1
        return false;
165
1
    }
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGFeBlend::Mode, std::__1::tuple<char const*, SkSVGFeBlend::Mode> [5]>(std::__1::tuple<char const*, SkSVGFeBlend::Mode> const (&) [5], SkSVGFeBlend::Mode*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGFeColorMatrixType, std::__1::tuple<char const*, SkSVGFeColorMatrixType> [4]>(std::__1::tuple<char const*, SkSVGFeColorMatrixType> const (&) [4], SkSVGFeColorMatrixType*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGFeFuncType, std::__1::tuple<char const*, SkSVGFeFuncType> [5]>(std::__1::tuple<char const*, SkSVGFeFuncType> const (&) [5], SkSVGFeFuncType*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGFeCompositeOperator, std::__1::tuple<char const*, SkSVGFeCompositeOperator> [6]>(std::__1::tuple<char const*, SkSVGFeCompositeOperator> const (&) [6], SkSVGFeCompositeOperator*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkColorChannel, std::__1::tuple<char const*, SkColorChannel> [4]>(std::__1::tuple<char const*, SkColorChannel> const (&) [4], SkColorChannel*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGFeMorphology::Operator, std::__1::tuple<char const*, SkSVGFeMorphology::Operator> [2]>(std::__1::tuple<char const*, SkSVGFeMorphology::Operator> const (&) [2], SkSVGFeMorphology::Operator*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGXmlSpace, std::__1::tuple<char const*, SkSVGXmlSpace> [2]>(std::__1::tuple<char const*, SkSVGXmlSpace> const (&) [2], SkSVGXmlSpace*)
bool SkSVGAttributeParser::parseEnumMap<SkSVGFontStyle::Type, std::__1::tuple<char const*, SkSVGFontStyle::Type> [4]>(std::__1::tuple<char const*, SkSVGFontStyle::Type> const (&) [4], SkSVGFontStyle::Type*)
Line
Count
Source
157
219
    bool parseEnumMap(const TArray& arr, T* result) {
158
1.09k
        for (size_t i = 0; i < std::size(arr); ++i) {
159
876
            if (this->parseExpectedStringToken(std::get<0>(arr[i]))) {
160
0
                *result = std::get<1>(arr[i]);
161
0
                return true;
162
0
            }
163
876
        }
164
219
        return false;
165
219
    }
bool SkSVGAttributeParser::parseEnumMap<SkSVGFontWeight::Type, std::__1::tuple<char const*, SkSVGFontWeight::Type> [14]>(std::__1::tuple<char const*, SkSVGFontWeight::Type> const (&) [14], SkSVGFontWeight::Type*)
Line
Count
Source
157
47
    bool parseEnumMap(const TArray& arr, T* result) {
158
79
        for (size_t i = 0; i < std::size(arr); ++i) {
159
79
            if (this->parseExpectedStringToken(std::get<0>(arr[i]))) {
160
47
                *result = std::get<1>(arr[i]);
161
47
                return true;
162
47
            }
163
79
        }
164
0
        return false;
165
47
    }
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGTextAnchor::Type, std::__1::tuple<char const*, SkSVGTextAnchor::Type> [4]>(std::__1::tuple<char const*, SkSVGTextAnchor::Type> const (&) [4], SkSVGTextAnchor::Type*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGPreserveAspectRatio::Align, std::__1::tuple<char const*, SkSVGPreserveAspectRatio::Align> [10]>(std::__1::tuple<char const*, SkSVGPreserveAspectRatio::Align> const (&) [10], SkSVGPreserveAspectRatio::Align*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGPreserveAspectRatio::Scale, std::__1::tuple<char const*, SkSVGPreserveAspectRatio::Scale> [2]>(std::__1::tuple<char const*, SkSVGPreserveAspectRatio::Scale> const (&) [2], SkSVGPreserveAspectRatio::Scale*)
Unexecuted instantiation: bool SkSVGAttributeParser::parseEnumMap<SkSVGColorspace, std::__1::tuple<char const*, SkSVGColorspace> [3]>(std::__1::tuple<char const*, SkSVGColorspace> const (&) [3], SkSVGColorspace*)
166
167
    // The current position in the input string.
168
    const char* fCurPos;
169
    const char* fEndPos;
170
171
    using INHERITED = SkNoncopyable;
172
};
173
174
#endif // SkSVGAttributeParser_DEFINED