Decode inline quoted-printable value.
val src : decoder -> Stdlib.Bytes.t -> int -> int -> unit
src d s j l
provides d
with l
bytes to read, starting at j
in s
. This byte range is read by calls to decode
with d
until `Await
is returned. To signal the end of input, call the function with l = 0
.
decode d
is:
`Await
ifd
has a`Manual
input source and awaits for more input. The client must usesrc
to provide it.`End
if the end of input was reached.`Malformed bytes
if thebytes
sequence is malformed according to the decoded quoted-printable encoding scheme. If you are interested in a best-effort decoding you can still continue to decode after an error until the decode synchronizes again on valid bytes.`Data data
if adata
sequence value was decoded.`Line line
if aline sequence value plus a line-break was decoded.
Note. Repeated invocation always eventually returns `End
, even in case of errors.
val decoder_byte_count : decoder -> int
decoder_byte_count d
is the number of characters already decoded on d
(included malformed ones). This is the last decode
's end output offset counting from beginning of the stream.
encode encoder
is:
`Partial
iffe
has a`Manual
destination and needs more output storage. The client must usedst
to provide a new buffer and then callencode
with`Await
until`Ok
is returned.`Ok
when the encoder is ready to encode a new`Char
,`Line_break
or`End
For `Manual
destination, encoding `End
always return `Partial
, the client should continue as usual with `Await
until `Ok
is returned at which point dst_rem
encoder
is guaranteed to be the sode of the last provided buffer (i.e. nothing was written).
Raises. Invalid_argument
if a `Char
, `Line_break
or `End
is encoded after a `Partial
encode.
val dst : encoder -> Stdlib.Bytes.t -> int -> int -> unit