<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class PathParser
```

## Functions



<h2 id="clear">clear</h2>

```kotlin
fun clear()
```


Clears the collection of `PathNode` stored in this parser and returned by `toNodes`.




<hr class="docs-overload-divider">


<h2 id="parsepathstring-pathdata">parsePathString</h2>

```kotlin
fun parsePathString(pathData: String): PathParser
```


Parses the SVG path string to extract `PathNode` instances for each path instruction
(`lineTo`, `moveTo`, etc.). The `PathNode` are stored in this parser's internal list of nodes
which can be queried by calling `toNodes`. Calling this method replaces any existing content
in the current nodes list.




<hr class="docs-overload-divider">


<h2 id="pathstringtonodes-pathdata">pathStringToNodes</h2>

```kotlin
fun pathStringToNodes(
        pathData: String,
        @Suppress("ConcreteCollection") nodes: ArrayList<PathNode> = ArrayList(),
    ): ArrayList<PathNode>
```


Parses the path string and adds the corresponding `PathNode` instances to the specified
`nodes` collection. This method returns `nodes`.




<hr class="docs-overload-divider">


<h2 id="addpathnodes-nodes">addPathNodes</h2>

```kotlin
fun addPathNodes(nodes: List<PathNode>): PathParser
```


Adds the list of `PathNode` `nodes` to this parser's internal list of `PathNode`. The
resulting list can be obtained by calling `toNodes`.




<hr class="docs-overload-divider">


<h2 id="tonodes">toNodes</h2>

```kotlin
fun toNodes(): List<PathNode>
```


Returns this parser's list of `PathNode`. Note: this function does not return a copy of the
list. The caller should make a copy when appropriate.




<hr class="docs-overload-divider">


<h2 id="topath-target">toPath</h2>

```kotlin
fun toPath(target: Path = Path()) = nodes?.toPath(target) ?: Path()
```


Converts this parser's list of `PathNode` instances into a `Path`. A new `Path` is returned
every time this method is invoked.