InOutBuffer

Types

Link copied to clipboard

Properties

Link copied to clipboard
abstract val column: Int
Link copied to clipboard
Link copied to clipboard
abstract val line: Int
Link copied to clipboard
Link copied to clipboard
abstract val offset: Int

Functions

Link copied to clipboard
open fun addCodepointToCopySequence(codepoint: Int)
Link copied to clipboard
open fun addDelimitedToCopySequence(delimiter: Char, pauseOnDelimiter: Boolean = true, consumeDelimiter: Boolean = true)

open fun addDelimitedToCopySequence(delimiter: String, pauseOnDelimiter: Boolean = true, consumeDelimiter: Boolean = true)

Read tokens into the sequence up to the expected delimiters. The delimiters will also be consumed.

Link copied to clipboard
inline fun InOutBuffer.addDelimitedToCopySequence(delimiter: Char, pauseOnDelimiter: Boolean = true, consumeDelimiter: Boolean = true, stopSequenceOnChar: (Char) -> Boolean)
inline fun InOutBuffer.addDelimitedToCopySequence(delimiter: String, pauseOnDelimiter: Boolean = true, consumeDelimiter: Boolean = true, stopSequenceOnChar: (Char) -> Boolean)
Link copied to clipboard
abstract fun addToCopySequence(char: Char)

Add the given character to the copy sequence. This requires an active copy sequence. It will force buffering of the underlying read characters if needed.

Link copied to clipboard

Finish/finalise a copy sequence. This means it cannot be appended to anymore

Link copied to clipboard
Link copied to clipboard
open fun markPeekedAsRead()
Link copied to clipboard
abstract fun pauseCopySequence()

Pause a copy sequence. This means that reading will not add further tokens to the sequence.

Link copied to clipboard
open fun peek(): Int

Try to read the next character without increasing the position

open fun peek(expected: Char): Boolean

Determine whether the next character is the expected character, but do not consume it.

open fun peek(expected: CharSequence): Boolean

Determine whether the following characters match the expected character sequence)

abstract fun peek(offset: Int): Int

Try to read the next character starting at the given offset.

open fun peek(offset: Int, expected: Char): Boolean
open fun peek(offset: Int, expected: CharSequence): Boolean

Determine whether the following characters match the expected character sequence starting at the given offset.

Link copied to clipboard
open fun peekChar(): Char
open fun peekChar(offset: Int): Char
Link copied to clipboard
abstract fun read(): Int

Does never read more than needed

Link copied to clipboard
open fun readChar(): Char
Link copied to clipboard
abstract fun readSubRange(start: Int, end: Int): CharSequence

Read a range of characters from the input buffer into a sequence. Note that this requires the characters to be still in the buffer. It is intended for handling peeks of entity reference names.

Link copied to clipboard
abstract fun readToCopyBuffer()

Read the current character to the copy buffer.

Link copied to clipboard
open fun readWS()

Read a sequence of at least 1 whitespace character.

Link copied to clipboard
abstract fun resumeCopySequence()
Link copied to clipboard
abstract fun skip(count: Int)

Skip the given amount of characters. This function should not be used to skip over line endings.

Link copied to clipboard
open fun skipWS()

Read a sequence of whitespace characters.

Link copied to clipboard
abstract fun startCopySequence()

Mark the start of a sequence that will be copied to string later. By default this will just store the start position. It however also triggers handling of special cases, that may trigger the use of a StringBuilder to store the sequence:

Link copied to clipboard
open fun tryRead(expected: Char): Boolean

Check that the next character is the expected character. If so, consume it.