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
|
|
|
|
|
|
|
#ifndef __NS_SVGDATAPARSER_H__
|
|
|
|
#define __NS_SVGDATAPARSER_H__
|
|
|
|
|
2013-10-29 21:15:39 +04:00
|
|
|
#include "mozilla/RangedPtr.h"
|
2013-09-23 21:25:00 +04:00
|
|
|
#include "nsString.h"
|
2006-06-16 21:20:25 +04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2013-10-29 21:15:39 +04:00
|
|
|
// nsSVGDataParser: a simple base class for parsing values
|
2006-06-16 21:20:25 +04:00
|
|
|
// for path and transform values.
|
2017-07-06 15:00:35 +03:00
|
|
|
//
|
2006-06-16 21:20:25 +04:00
|
|
|
class nsSVGDataParser
|
|
|
|
{
|
|
|
|
public:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit nsSVGDataParser(const nsAString& aValue);
|
2006-06-16 21:20:25 +04:00
|
|
|
|
|
|
|
protected:
|
2014-01-04 19:02:17 +04:00
|
|
|
static bool IsAlpha(char16_t aCh) {
|
2013-10-29 21:15:39 +04:00
|
|
|
// Exclude non-ascii characters before calling isalpha
|
|
|
|
return (aCh & 0x7f) == aCh && isalpha(aCh);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns true if there are more characters to read, false otherwise.
|
|
|
|
bool SkipCommaWsp();
|
|
|
|
|
|
|
|
// Returns true if there are more characters to read, false otherwise.
|
|
|
|
bool SkipWsp();
|
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
mozilla::RangedPtr<const char16_t> mIter;
|
|
|
|
const mozilla::RangedPtr<const char16_t> mEnd;
|
2006-06-16 21:20:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __NS_SVGDATAPARSER_H__
|