heavyfishdesign: github.com/dustismo/heavyfishdesign/parser Index | Files

package parser

import "github.com/dustismo/heavyfishdesign/parser"

Index

Package Files

parser.go svgparser.go

func ElementToPath Uses

func ElementToPath(elem *Element, log *util.HfdLog) (path.Path, error)

convert this element to a path

func InitContext Uses

func InitContext()

type DefaultDocumentParser Uses

type DefaultDocumentParser struct {
}

func NewDocumentParser Uses

func NewDocumentParser() DefaultDocumentParser

func (DefaultDocumentParser) LoadBytes Uses

func (p DefaultDocumentParser) LoadBytes(filename string) ([]byte, error)

func (DefaultDocumentParser) Parse Uses

func (p DefaultDocumentParser) Parse(bytes []byte, logger *util.HfdLog) (*dom.Document, error)

type Element Uses

type Element struct {
    Name       string
    Attributes *dynmap.DynMap // map[string]string
    Children   []*Element
    Content    string
}

Element is a representation of an SVG element.

func DecodeFirst Uses

func DecodeFirst(decoder *xml.Decoder) (*Element, error)

DecodeFirst creates the first element from the decoder.

func NewElement Uses

func NewElement(token xml.StartElement) *Element

NewElement creates element from decoder token.

func Parse Uses

func Parse(source io.Reader, validate bool) (*Element, error)

Parse creates an Element instance from an SVG input.

func (*Element) Compare Uses

func (e *Element) Compare(o *Element) bool

Compare compares two elements.

func (*Element) Decode Uses

func (e *Element) Decode(decoder *xml.Decoder) error

Decode decodes the child elements of element.

type SVGParser Uses

type SVGParser struct {
}

func (SVGParser) ParseSVG Uses

func (s SVGParser) ParseSVG(xml string, logger *util.HfdLog) (path.Path, error)

parses an SVG file for any Path Elements and joining them together

Package parser imports 13 packages (graph) and is imported by 1 packages. Updated 2020-07-29. Refresh now. Tools for package owners.