Safe Haskell | None |
---|---|
Language | GHC2021 |
Binrep.Type.NullTerminated
Description
C-style null-terminated data.
I mix string and bytestring terminology here, due to bad C influences. This
module is specifically interested in bytestrings and their encoding. String/text
encoding is handled in Text
.
Synopsis
- data NullTerminate
- type NullTerminated = Refined NullTerminate
Documentation
data NullTerminate Source #
Null-terminated data. Arbitrary length terminated with a null byte. Permits no null bytes inside the data.
Instances
Predicate NullTerminate Source # | |||||
Defined in Binrep.Type.NullTerminated Associated Types
| |||||
Refine NullTerminate ByteString Source # | Null-terminated data may not contain any null bytes. | ||||
Defined in Binrep.Type.NullTerminated Methods validate :: Proxy# NullTerminate -> ByteString -> Maybe RefineFailure # | |||||
BLen a => BLen (NullTerminated a) Source # | |||||
Defined in Binrep.Type.NullTerminated Methods blen :: NullTerminated a -> Int Source # | |||||
Get a => Get (NullTerminated a) Source # | We may parse any null-terminated data using a special flatparse combinator. The combinator doesn't permit distinguishing between the two possible failures: either there was no next null, or the inner parser didn't consume up to it. | ||||
Defined in Binrep.Type.NullTerminated Methods get :: Getter (NullTerminated a) Source # | |||||
Put a => Put (NullTerminated a) Source # | Serialization of null-terminated data may be defined generally using the data's underlying serializer. | ||||
Defined in Binrep.Type.NullTerminated Methods put :: NullTerminated a -> Putter Source # | |||||
type PredicateName d NullTerminate Source # | |||||
Defined in Binrep.Type.NullTerminated |
type NullTerminated = Refined NullTerminate Source #