- data Parser
- data ParserCallbacks = ParserCallbacks {
- parsedNull :: IO Bool
- parsedBoolean :: Bool -> IO Bool
- parsedNumber :: ByteString -> IO Bool
- parsedText :: Text -> IO Bool
- parsedBeginArray :: IO Bool
- parsedEndArray :: IO Bool
- parsedBeginObject :: IO Bool
- parsedAttributeName :: Text -> IO Bool
- parsedEndObject :: IO Bool
- data ParseStatus
- newParser :: ParserCallbacks -> IO Parser
- parseUTF8 :: Parser -> ByteString -> IO ParseStatus
- parseText :: Parser -> Text -> IO ParseStatus
- parseComplete :: Parser -> IO ParseStatus
- getBytesConsumed :: Parser -> IO Integer
- data Generator
- data GeneratorConfig = GeneratorConfig {}
- data GeneratorError
- newGenerator :: GeneratorConfig -> IO Generator
- getBuffer :: Generator -> IO ByteString
- clearBuffer :: Generator -> IO ()
- generateNull :: Generator -> IO ()
- generateBoolean :: Generator -> Bool -> IO ()
- generateIntegral :: Integral a => Generator -> a -> IO ()
- generateDouble :: Generator -> Double -> IO ()
- generateNumber :: Generator -> ByteString -> IO ()
- generateText :: Generator -> Text -> IO ()
- generateBeginArray :: Generator -> IO ()
- generateEndArray :: Generator -> IO ()
- generateBeginObject :: Generator -> IO ()
- generateEndObject :: Generator -> IO ()
Parser
data ParserCallbacks 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. |
parseUTF8 :: Parser -> ByteString -> IO ParseStatusSource
parseComplete :: Parser -> IO ParseStatusSource
Indicate that no more input is available, and parse any remaining buffered input.
getBytesConsumed :: Parser -> IO 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 -> IO GeneratorSource
Create a new, empty generator with the given configuration.
getBuffer :: Generator -> IO ByteStringSource
Retrieve the NUL
-terminated byte buffer.
clearBuffer :: Generator -> IO ()Source
Clear the generator's output buffer. This does not change the state of the generator.
Generator events
generateNull :: Generator -> IO ()Source
generateNumber :: Generator -> ByteString -> IO ()Source
generateEndArray :: Generator -> IO ()Source
generateEndObject :: Generator -> IO ()Source