2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-06-16 21:20:25 +04:00
|
|
|
|
|
|
|
#include "nsSVGDataParser.h"
|
2013-10-29 21:15:39 +04:00
|
|
|
#include "SVGContentUtils.h"
|
2006-06-16 21:20:25 +04:00
|
|
|
|
2013-10-29 21:15:39 +04:00
|
|
|
nsSVGDataParser::nsSVGDataParser(const nsAString& aValue)
|
|
|
|
: mIter(SVGContentUtils::GetStartRangedPtr(aValue)),
|
|
|
|
mEnd(SVGContentUtils::GetEndRangedPtr(aValue))
|
2006-06-16 21:20:25 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-29 21:15:39 +04:00
|
|
|
bool
|
|
|
|
nsSVGDataParser::SkipCommaWsp()
|
2006-06-16 21:20:25 +04:00
|
|
|
{
|
2013-10-29 21:15:39 +04:00
|
|
|
if (!SkipWsp()) {
|
|
|
|
// end of string
|
|
|
|
return false;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
if (*mIter != ',') {
|
|
|
|
return true;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
++mIter;
|
|
|
|
return SkipWsp();
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
|
|
|
|
2013-10-29 21:15:39 +04:00
|
|
|
bool
|
|
|
|
nsSVGDataParser::SkipWsp()
|
2006-06-16 21:20:25 +04:00
|
|
|
{
|
2013-10-29 21:15:39 +04:00
|
|
|
while (mIter != mEnd) {
|
|
|
|
if (!IsSVGWhitespace(*mIter)) {
|
|
|
|
return true;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
++mIter;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|
2013-10-29 21:15:39 +04:00
|
|
|
return false;
|
2006-06-16 21:20:25 +04:00
|
|
|
}
|