abla/yaml/emitter
Generated from source.
Source module; follow its importing module's re-export links.
Source: abla/yaml/emitter.ab
YamlEmitOptions (class)
class YamlEmitOptions(val indent: int = 2, val newline: string = "\n",
val finalNewline: bool = true, val flow: bool = false)
Controls indentation width, LF or CRLF newlines, whether to add a final newline, and whether collections use flow syntax.
YamlEmitResult (class)
class YamlEmitResult(val text: string, val succeeded: bool, val error: YamlError)
The generated YAML text on success, or an empty string and an error on failure.
YamlEmitter (class)
class YamlEmitter(val output: ByteBuffer, val limits: YamlLimits,
val options: YamlEmitOptions, var nodes: int, var scalarBytes: int,
var work: int, var code: string, var message: string)
Holds output, emission limits and the first error during YAML serialization.
YamlEmitter.fail (extension fun)
fun YamlEmitter.fail(code: string, message: string): void
Records the first emission error.
YamlEmitter.write (extension fun)
fun YamlEmitter.write(text: string): void
Appends text unless doing so exceeds the output byte limit.
yamlHexByte (fun)
fun yamlHexByte(value: int): string
Returns the two hexadecimal digits representing a byte.
yamlQuote (fun)
fun yamlQuote(text: string): string
Always quote strings in fresh output: Core resolution and punctuation cannot change their type. The lossless editor may retain an existing scalar style.
YamlEmitter.indentation (extension fun)
fun YamlEmitter.indentation(indent: int): void
Appends the requested spaces to the output within the byte budget.
YamlEmitter.enter (extension fun)
fun YamlEmitter.enter(value: Yaml, depth: int): bool
Checks the value's depth, shape and budget and returns whether emission may proceed.
YamlEmitter.scalar (extension fun)
fun YamlEmitter.scalar(value: Yaml): void
Writes a scalar YAML representation or records an invalid-scalar error.
YamlEmitter.checkKey (extension fun)
fun YamlEmitter.checkKey(value: Yaml, var seen: Map<string, int>): void
Records an error for a key that is invalid or duplicated within the current mapping.
yamlNonemptyCollection (fun)
fun yamlNonemptyCollection(value: Yaml): bool
Returns whether a sequence or mapping contains members.
YamlEmitter.emit (extension fun)
fun YamlEmitter.emit(value: Yaml, depth: int, indent: int, flow: bool): void
Writes a supported YAML value in the requested context and records the first validation or limit error.
yamlEmit (fun)
fun yamlEmit(value: Yaml, options: YamlEmitOptions = YamlEmitOptions(),
limits: YamlLimits = yamlDefaultLimits()): YamlEmitResult
Serializes value using options and limits. Returns empty text and an error when the value, options, or limits are invalid or output exceeds a limit.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.