ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Json.StringEncoding

Description

JSON string bytes and exact lengths shared by packed values and their writer.

Synopsis

Documentation

encodeString :: Text -> ByteString Source #

The bytes aeson writes for a string, quotes included: encodedLength of them.

encodedLength :: Text -> Int Source #

The length of encodeString, from the escape writeEncoded writes for each byte.

writeEncoded :: Text -> MutableByteArray st -> Int -> ST st Int Source #

Write encodeString at an offset, and return the offset after it.

writeEncodedSized :: Text -> Int -> MutableByteArray st -> Int -> ST st Int Source #

Like writeEncoded: the length must equal encodedLength for this same text without Int overflow, and fit from a non-negative target offset.

plain :: Text -> Bool Source #

Whether aeson writes the string's bytes as they are: no backslash, quote or byte below a space.

quote :: Word8 Source #

The quote byte that opens and closes a string's encoding.