/src/mozilla-central/dom/svg/nsSVGDataParser.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "nsSVGDataParser.h" |
8 | | #include "nsContentUtils.h" |
9 | | #include "SVGContentUtils.h" |
10 | | |
11 | | nsSVGDataParser::nsSVGDataParser(const nsAString& aValue) |
12 | | : mIter(SVGContentUtils::GetStartRangedPtr(aValue)), |
13 | | mEnd(SVGContentUtils::GetEndRangedPtr(aValue)) |
14 | 0 | { |
15 | 0 | } |
16 | | |
17 | | bool |
18 | | nsSVGDataParser::SkipCommaWsp() |
19 | 0 | { |
20 | 0 | if (!SkipWsp()) { |
21 | 0 | // end of string |
22 | 0 | return false; |
23 | 0 | } |
24 | 0 | if (*mIter != ',') { |
25 | 0 | return true; |
26 | 0 | } |
27 | 0 | ++mIter; |
28 | 0 | return SkipWsp(); |
29 | 0 | } |
30 | | |
31 | | bool |
32 | | nsSVGDataParser::SkipWsp() |
33 | 0 | { |
34 | 0 | while (mIter != mEnd) { |
35 | 0 | if (!nsContentUtils::IsHTMLWhitespace(*mIter)) { |
36 | 0 | return true; |
37 | 0 | } |
38 | 0 | ++mIter; |
39 | 0 | } |
40 | 0 | return false; |
41 | 0 | } |