2006-06-16 17:20:25 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 17:20:25 +00:00
|
|
|
|
|
|
|
#include "nsSVGDataParser.h"
|
2013-10-29 17:15:39 +00:00
|
|
|
#include "SVGContentUtils.h"
|
2006-06-16 17:20:25 +00:00
|
|
|
|
2013-10-29 17:15:39 +00:00
|
|
|
nsSVGDataParser::nsSVGDataParser(const nsAString& aValue)
|
|
|
|
: mIter(SVGContentUtils::GetStartRangedPtr(aValue)),
|
|
|
|
mEnd(SVGContentUtils::GetEndRangedPtr(aValue))
|
2006-06-16 17:20:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-29 17:15:39 +00:00
|
|
|
bool
|
|
|
|
nsSVGDataParser::SkipCommaWsp()
|
2006-06-16 17:20:25 +00:00
|
|
|
{
|
2013-10-29 17:15:39 +00:00
|
|
|
if (!SkipWsp()) {
|
|
|
|
// end of string
|
|
|
|
return false;
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|
2013-10-29 17:15:39 +00:00
|
|
|
if (*mIter != ',') {
|
|
|
|
return true;
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|
2013-10-29 17:15:39 +00:00
|
|
|
++mIter;
|
|
|
|
return SkipWsp();
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|
|
|
|
|
2013-10-29 17:15:39 +00:00
|
|
|
bool
|
|
|
|
nsSVGDataParser::SkipWsp()
|
2006-06-16 17:20:25 +00:00
|
|
|
{
|
2013-10-29 17:15:39 +00:00
|
|
|
while (mIter != mEnd) {
|
|
|
|
if (!IsSVGWhitespace(*mIter)) {
|
|
|
|
return true;
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|
2013-10-29 17:15:39 +00:00
|
|
|
++mIter;
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|
2013-10-29 17:15:39 +00:00
|
|
|
return false;
|
2006-06-16 17:20:25 +00:00
|
|
|
}
|