LibYamlUtils¶
Usage
use Yaml.LibYamlUtils;
or
import Yaml.LibYamlUtils;
- config param YamlUtilsVerbose = false¶
- const YAML_NO_EVENT: c_int¶
- const YAML_STREAM_START_EVENT: c_int¶
- const YAML_STREAM_END_EVENT: c_int¶
- const YAML_DOCUMENT_START_EVENT: c_int¶
- const YAML_DOCUMENT_END_EVENT: c_int¶
- const YAML_ALIAS_EVENT: c_int¶
- const YAML_SCALAR_EVENT: c_int¶
- const YAML_SEQUENCE_START_EVENT: c_int¶
- const YAML_SEQUENCE_END_EVENT: c_int¶
- const YAML_MAPPING_START_EVENT: c_int¶
- const YAML_MAPPING_END_EVENT: c_int¶
- enum EventType { None, StreamStart, StreamEnd, DocumentStart, DocumentEnd, Alias, Scalar, SequenceStart, SequenceEnd, MappingStart, MappingEnd }¶
- proc getEvent(flag: c_int): EventType¶
- operator :(e: EventType, type t: string)
- record yaml_parser_t¶
- record yaml_emitter_t¶
- const YAML_ANY_ENCODING: c_int¶
- const YAML_UTF8_ENCODING: c_int¶
- const YAML_UTF16LE_ENCODING: c_int¶
- const YAML_UTF16BE_ENCODING: c_int¶
- const YAML_ANY_SEQUENCE_STYLE: c_int¶
- const YAML_BLOCK_SEQUENCE_STYLE: c_int¶
- const YAML_FLOW_SEQUENCE_STYLE: c_int¶
- const YAML_ANY_MAPPING_STYLE: c_int¶
- const YAML_BLOCK_MAPPING_STYLE: c_int¶
- const YAML_FLOW_MAPPING_STYLE: c_int¶
- const YAML_ANY_SCALAR_STYLE: c_int¶
- const YAML_PLAIN_SCALAR_STYLE: c_int¶
- const YAML_SINGLE_QUOTED_SCALAR_STYLE: c_int¶
- const YAML_DOUBLE_QUOTED_SCALAR_STYLE: c_int¶
- const YAML_LITERAL_SCALAR_STYLE: c_int¶
- const YAML_FOLDED_SCALAR_STYLE: c_int¶
- proc seqStyleToFlag(style: YamlSequenceStyle): c_int¶
- proc mapStyleToFlag(style: YamlMappingStyle): c_int¶
- proc scalarStyleToFlag(style: YamlScalarStyle): c_int¶
- class LibYamlEmitter¶
- var seqStyle: YamlSequenceStyle¶
- var mapStyle: YamlMappingStyle¶
- var scalarStyle: YamlScalarStyle¶
- var documentStyle: YamlDocumentStyle¶
- var emitter: yaml_emitter_t¶
- var event: yaml_event_t¶
- var file: c_ptr(c_FILE) = nil¶
- proc LibYamlEmitter.init(sequences = YamlSequenceStyle.Any, mappings = YamlMappingStyle.Any, scalars = YamlScalarStyle.Any, documents = YamlDocumentStyle.Explicit)¶
- proc LibYamlEmitter.deinit()¶
- proc LibYamlEmitter.serialize(fw, serializer) throws¶
- proc LibYamlEmitter.openContext(styleHint = YamlDocumentStyle.Default) throws¶
- proc LibYamlEmitter.closeContext(): bytes throws¶
- proc LibYamlEmitter.openFile(path: string, styleHint = YamlDocumentStyle.Default) throws¶
- proc LibYamlEmitter.emitEvent(param name: string) throws¶
- proc LibYamlEmitter.startSequence(ref tag: bytes = b"", styleHint = YamlSequenceStyle.Default) throws¶
- proc LibYamlEmitter.endSequence() throws¶
- proc LibYamlEmitter.startMapping(ref tag: bytes = b"", styleHint = YamlMappingStyle.Default) throws¶
- proc LibYamlEmitter.endMapping() throws¶
- proc LibYamlEmitter.emitScalar(value: bytes, ref tag: bytes = b"", styleHint = YamlScalarStyle.Default) throws¶
- proc LibYamlEmitter.emitAlias(ref value: bytes) throws¶
- proc LibYamlEmitter.startDocument(styleHint = YamlDocumentStyle.Default) throws¶
- proc LibYamlEmitter.endDocument(styleHint = YamlDocumentStyle.Default) throws¶
- proc LibYamlEmitter._startOutputStream() throws¶
- proc LibYamlEmitter._endOutputStream() throws¶
- proc LibYamlEmitter.chooseSeqStyle(styleHint: YamlSequenceStyle): c_int¶
- proc LibYamlEmitter.chooseMapStyle(styleHint: YamlMappingStyle): c_int¶
- proc LibYamlEmitter.chooseScalarStyle(styleHint: YamlScalarStyle): c_int¶
- proc LibYamlEmitter.chooseDocumentStyle(hint: YamlDocumentStyle): c_int¶
- proc LibYamlEmitter.yamlStringifyPrimitive(const val: ?t, processStrings: bool): bytes¶
- class LibYamlParser¶
- var parser: yaml_parser_t¶
- var event: yaml_event_t¶
- var cachedEvent: (EventType, uint, uint)¶
- var fileIsAttached = false¶
- var f: c_ptr(c_FILE) = nil¶
- proc LibYamlParser.init()¶
- proc LibYamlParser.deinit()¶
- proc LibYamlParser.attachFile(fr) throws¶
- proc LibYamlParser.finishFile(fr) throws¶
- proc LibYamlParser.expectEvent(fr, e: EventType): 2*(uint) throws¶
- proc LibYamlParser.peekFor(fr, e: EventType): bool throws¶
- proc LibYamlParser.parseNext(fr): (EventType, uint, uint) throws¶