Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: Source/core/svg/SVGParserUtilities.h

Issue 1023993002: Rework the SVGPathSource interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blender fixups. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/svg/SVGParserUtilities.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2002, 2003 The Karbon Developers 2 * Copyright (C) 2002, 2003 The Karbon Developers
3 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }; 42 };
43 43
44 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace); 44 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace);
45 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace); 45 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace);
46 bool parseNumberOptionalNumber(const String& s, float& h, float& v); 46 bool parseNumberOptionalNumber(const String& s, float& h, float& v);
47 bool parseNumberOrPercentage(const String& s, float& number); 47 bool parseNumberOrPercentage(const String& s, float& number);
48 bool parseArcFlag(const LChar*& ptr, const LChar* end, bool& flag); 48 bool parseArcFlag(const LChar*& ptr, const LChar* end, bool& flag);
49 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag); 49 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag);
50 50
51 template <typename CharType> 51 template <typename CharType>
52 bool parseFloatPoint(const CharType*& current, const CharType* end, FloatPoint&) ;
53 template <typename CharType>
54 bool parseFloatPoint2(const CharType*& current, const CharType* end, FloatPoint& , FloatPoint&);
55 template <typename CharType>
56 bool parseFloatPoint3(const CharType*& current, const CharType* end, FloatPoint& , FloatPoint&, FloatPoint&);
57
58 template <typename CharType>
59 inline bool skipOptionalSVGSpaces(const CharType*& ptr, const CharType* end) 52 inline bool skipOptionalSVGSpaces(const CharType*& ptr, const CharType* end)
60 { 53 {
61 while (ptr < end && isHTMLSpace<CharType>(*ptr)) 54 while (ptr < end && isHTMLSpace<CharType>(*ptr))
62 ptr++; 55 ptr++;
63 return ptr < end; 56 return ptr < end;
64 } 57 }
65 58
66 template <typename CharType> 59 template <typename CharType>
67 inline bool skipOptionalSVGSpacesOrDelimiter(const CharType*& ptr, const CharTyp e* end, char delimiter = ',') 60 inline bool skipOptionalSVGSpacesOrDelimiter(const CharType*& ptr, const CharTyp e* end, char delimiter = ',')
68 { 61 {
69 if (ptr < end && !isHTMLSpace<CharType>(*ptr) && *ptr != delimiter) 62 if (ptr < end && !isHTMLSpace<CharType>(*ptr) && *ptr != delimiter)
70 return false; 63 return false;
71 if (skipOptionalSVGSpaces(ptr, end)) { 64 if (skipOptionalSVGSpaces(ptr, end)) {
72 if (ptr < end && *ptr == delimiter) { 65 if (ptr < end && *ptr == delimiter) {
73 ptr++; 66 ptr++;
74 skipOptionalSVGSpaces(ptr, end); 67 skipOptionalSVGSpaces(ptr, end);
75 } 68 }
76 } 69 }
77 return ptr < end; 70 return ptr < end;
78 } 71 }
79 72
80 template<typename CharType> 73 template<typename CharType>
81 bool parseAndSkipTransformType(const CharType*& ptr, const CharType* end, SVGTra nsformType&); 74 bool parseAndSkipTransformType(const CharType*& ptr, const CharType* end, SVGTra nsformType&);
82 SVGTransformType parseTransformType(const String&); 75 SVGTransformType parseTransformType(const String&);
83 76
84 } // namespace blink 77 } // namespace blink
85 78
86 #endif // SVGParserUtilities_h 79 #endif // SVGParserUtilities_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGParserUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698