StreamReader

class StreamReader(loadSettings: LoadSettings, stream: Source)

Read the provided stream of code points into String and implement look-ahead operations. Checks if code points are in the allowed range.

Parameters

loadSettings
  • configuration options

stream
  • the input

Constructors

Link copied to clipboard
constructor(loadSettings: LoadSettings, stream: String)

Create

constructor(loadSettings: LoadSettings, stream: Source)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var column: Int
Link copied to clipboard

Get the position of the current char in the current YAML document

Link copied to clipboard
var index: Int

index is only required to implement 1024 key length restriction and the total length restriction

Link copied to clipboard
var line: Int

Functions

Link copied to clipboard
fun forward(length: Int = 1)

read the next length characters and move the pointer.

Link copied to clipboard
fun getMark(): Mark?

Generate Mark if it is configured

Link copied to clipboard
fun peek(): Int

Peek the next code point (look without moving the pointer)

fun peek(index: Int): Int

Peek the next index-th code point

Link copied to clipboard
fun prefix(length: Int): String

Create String from code points

Link copied to clipboard
fun prefixForward(length: Int): String

prefix(length) immediately followed by forward(length)

Link copied to clipboard

Reset the position to start (at the start of a new document in the stream)