- data Parser s
- data ParserCallbacks s = ParserCallbacks {
- parsedNull :: ST s Bool
- parsedBoolean :: Bool -> ST s Bool
- parsedNumber :: ByteString -> ST s Bool
- parsedText :: Text -> ST s Bool
- parsedBeginArray :: ST s Bool
- parsedEndArray :: ST s Bool
- parsedBeginObject :: ST s Bool
- parsedAttributeName :: Text -> ST s Bool
- parsedEndObject :: ST s Bool
- data ParseStatus
- newParser :: ParserCallbacks s -> ST s (Parser s)
- parseUTF8 :: Parser s -> ByteString -> ST s ParseStatus
- parseText :: Parser s -> Text -> ST s ParseStatus
- parseComplete :: Parser s -> ST s ParseStatus
- getBytesConsumed :: Parser s -> ST s Integer
- data Generator s
- data GeneratorConfig = GeneratorConfig {}
- data GeneratorError
- newGenerator :: GeneratorConfig -> ST s (Generator s)
- getBuffer :: Generator s -> ST s ByteString
- clearBuffer :: Generator s -> ST s ()
- generateNull :: Generator s -> ST s ()
- generateBoolean :: Generator s -> Bool -> ST s ()
- generateIntegral :: Integral a => Generator s -> a -> ST s ()
- generateDouble :: Generator s -> Double -> ST s ()
- generateNumber :: Generator s -> ByteString -> ST s ()
- generateText :: Generator s -> Text -> ST s ()
- generateBeginArray :: Generator s -> ST s ()
- generateEndArray :: Generator s -> ST s ()
- generateBeginObject :: Generator s -> ST s ()
- generateEndObject :: Generator s -> ST s ()
Parser
data ParserCallbacks s Source
ParserCallbacks | |
|
data ParseStatus Source
ParseFinished | |
ParseContinue | More input is required before parsing can complete. |
ParseCancelled | A callback returned |
ParseError Text | An error occured while parsing. The included message contains details about the error. |
newParser :: ParserCallbacks s -> ST s (Parser s)Source
parseUTF8 :: Parser s -> ByteString -> ST s ParseStatusSource
parseComplete :: Parser s -> ST s ParseStatusSource
Indicate that no more input is available, and parse any remaining buffered input.
getBytesConsumed :: Parser s -> ST s IntegerSource
Get the number of bytes consumed from the last input chunk.
Note that if using parseText
, this corresponds to UTF-8 bytes,
not characters.
If the most recent call to parseUTF8
or parseText
returned
ParseFinished
, this will indicate whether there are any un-parsed
bytes past the end of input.
If the most recent parse returned ParseError
, this will indicate where
the error occured.
Generator
data GeneratorConfig Source
GeneratorConfig | |
|
data GeneratorError Source
If an error is encountered when generating data, a GeneratorError
will be thrown.
With the exception of MaximumDepthExceeded
, this is usually due to
incorrect use of the library.
newGenerator :: GeneratorConfig -> ST s (Generator s)Source
Create a new, empty generator with the given configuration.
getBuffer :: Generator s -> ST s ByteStringSource
Retrieve the NUL
-terminated byte buffer.
clearBuffer :: Generator s -> ST s ()Source
Clear the generator's output buffer. This does not change the state of the generator.
Generator events
generateNull :: Generator s -> ST s ()Source
generateNumber :: Generator s -> ByteString -> ST s ()Source
generateBeginArray :: Generator s -> ST s ()Source
generateEndArray :: Generator s -> ST s ()Source
generateBeginObject :: Generator s -> ST s ()Source
generateEndObject :: Generator s -> ST s ()Source