bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& result, PathParsingMode parsingMode) { result.clear(); if (list.isEmpty()) return true; SVGPathSegListSource source(list); return SVGPathParser::parseToByteStream(source, result, parsingMode); }
bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode) { result = String(); if (list.isEmpty()) return true; SVGPathSegListSource source(list); return SVGPathParser::parseToString(source, result, parsingMode); }
bool SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, OwnPtr<SVGPathByteStream>& result, PathParsingMode parsingMode) { result = SVGPathByteStream::create(); if (list.isEmpty()) return false; SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result.get()); OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(list); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(parsingMode); parser->cleanup(); return ok; }
bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode) { result = String(); if (list.isEmpty()) return true; SVGPathStringBuilder* builder = globalSVGPathStringBuilder(); auto source = std::make_unique<SVGPathSegListSource>(list); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(parsingMode); result = builder->result(); parser->cleanup(); return ok; }
bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream* result, PathParsingMode parsingMode) { ASSERT(result); result->clear(); if (list.isEmpty()) return true; SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result); auto source = std::make_unique<SVGPathSegListSource>(list); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(parsingMode); parser->cleanup(); return ok; }
bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode) { result = String(); if (list.isEmpty()) return false; SVGPathStringBuilder* builder = globalSVGPathStringBuilder(); OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(list); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(parsingMode); result = builder->result(); parser->cleanup(); return ok; }