Copyright | (c) Dong Han 2020 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
LibYAML bindings, which provide streaming YAML read & write.
Synopsis
- data MarkedEvent = MarkedEvent {}
- data Mark = Mark {}
- data Event
- data Tag
- type Anchor = Text
- initParser :: HasCallStack => Bytes -> Resource (Source MarkedEvent)
- initFileParser :: HasCallStack => CBytes -> Resource (Source MarkedEvent)
- data YAMLFormatOpts = YAMLFormatOpts {
- yamlFormatCanonical :: Bool
- yamlFormatIndent :: Int
- yamlFormatWidth :: Int
- yamlFormatRenderTags :: Event -> TagRender
- initEmitter :: HasCallStack => YAMLFormatOpts -> Resource (Ptr EmitterStruct, Sink Event)
- initFileEmitter :: HasCallStack => YAMLFormatOpts -> CBytes -> Resource (Sink Event)
- getEmitterResult :: Ptr EmitterStruct -> IO Text
- defaultYAMLFormatOpts :: YAMLFormatOpts
- renderScalarTags :: Event -> TagRender
- renderAllTags :: Event -> TagRender
- renderNoTags :: Event -> TagRender
- renderUriTags :: Event -> TagRender
- type ScalarStyle = CInt
- pattern Any :: ScalarStyle
- pattern Plain :: ScalarStyle
- pattern SingleQuoted :: ScalarStyle
- pattern DoubleQuoted :: ScalarStyle
- pattern Literal :: ScalarStyle
- pattern Folded :: ScalarStyle
- pattern PlainNoTag :: ScalarStyle
- type SequenceStyle = CInt
- pattern AnySequence :: SequenceStyle
- pattern BlockSequence :: SequenceStyle
- pattern FlowSequence :: SequenceStyle
- type MappingStyle = CInt
- pattern AnyMapping :: MappingStyle
- pattern BlockMapping :: MappingStyle
- pattern FlowMapping :: MappingStyle
- data LibYAMLException
The event stream
data MarkedEvent Source #
Instances
The pointer position
Instances
Eq Mark Source # | |
Ord Mark Source # | |
Show Mark Source # | |
Generic Mark Source # | |
ToValue Mark Source # | |
Defined in Z.Data.YAML.FFI | |
EncodeJSON Mark Source # | |
Defined in Z.Data.YAML.FFI encodeJSON :: Mark -> Builder () # | |
FromValue Mark Source # | |
ShowT Mark Source # | |
Defined in Z.Data.YAML.FFI toUTF8BuilderP :: Int -> Mark -> Builder () # | |
type Rep Mark Source # | |
Defined in Z.Data.YAML.FFI type Rep Mark = D1 ('MetaData "Mark" "Z.Data.YAML.FFI" "Z-YAML-0.1.0.0-9s3yJPeTIfnHYFQzctMYUL" 'False) (C1 ('MetaCons "Mark" 'PrefixI 'True) (S1 ('MetaSel ('Just "yamlIndex") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "yamlLine") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "yamlColumn") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int)))) |
Instances
Instances
Decoding
initParser :: HasCallStack => Bytes -> Resource (Source MarkedEvent) Source #
Create a source that yields marked events from a piece of YAML bytes.
initFileParser :: HasCallStack => CBytes -> Resource (Source MarkedEvent) Source #
Create a source that yields marked events from a piece of YAML bytes.
Encoding
data YAMLFormatOpts Source #
Contains options relating to the formatting (indendation, width) of the YAML output.
YAMLFormatOpts | |
|
initEmitter :: HasCallStack => YAMLFormatOpts -> Resource (Ptr EmitterStruct, Sink Event) Source #
Make a new YAML event sink, whose result can be fetched via getEmitterResult
.
initFileEmitter :: HasCallStack => YAMLFormatOpts -> CBytes -> Resource (Sink Event) Source #
renderScalarTags :: Event -> TagRender Source #
A value for formatOptionsRenderTags
that renders no
collection tags but all scalar tags (unless suppressed with styles
'NoTag or PlainNoTag
).
renderAllTags :: Event -> TagRender Source #
A value for formatOptionsRenderTags
that renders all
tags (except NoTag
tag and PlainNoTag
style).
renderNoTags :: Event -> TagRender Source #
A value for formatOptionsRenderTags
that renders no
tags.
renderUriTags :: Event -> TagRender Source #
Constants
type ScalarStyle = CInt Source #
Style for scalars - e.g. quoted / folded
pattern Any :: ScalarStyle Source #
pattern Plain :: ScalarStyle Source #
pattern SingleQuoted :: ScalarStyle Source #
pattern DoubleQuoted :: ScalarStyle Source #
pattern Literal :: ScalarStyle Source #
pattern Folded :: ScalarStyle Source #
pattern PlainNoTag :: ScalarStyle Source #
type SequenceStyle = CInt Source #
Style for sequences - e.g. block or flow
pattern AnySequence :: SequenceStyle Source #
pattern BlockSequence :: SequenceStyle Source #
pattern FlowSequence :: SequenceStyle Source #
type MappingStyle = CInt Source #
Style for mappings - e.g. block or flow
pattern AnyMapping :: MappingStyle Source #
pattern BlockMapping :: MappingStyle Source #
pattern FlowMapping :: MappingStyle Source #
Exception type
data LibYAMLException Source #
Instances
Show LibYAMLException Source # | |
Defined in Z.Data.YAML.FFI showsPrec :: Int -> LibYAMLException -> ShowS # show :: LibYAMLException -> String # showList :: [LibYAMLException] -> ShowS # | |
Exception LibYAMLException Source # | |
Defined in Z.Data.YAML.FFI |