binrep-0.8.0: Encode precise binary representations directly in types
Safe HaskellSafe-Inferred
LanguageGHC2021

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

Documentation

data NullTerminate Source #

Null-terminated data. Arbitrary length terminated with a null byte. Permits no null bytes inside the data.

Instances

Instances details
NullCheck a => Predicate NullTerminate a Source #

Null-terminated data may not contain any null bytes.

Instance details

Defined in Binrep.Type.NullTerminated

BLen a => BLen (NullTerminated a) Source # 
Instance details

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.

Instance details

Defined in Binrep.Type.NullTerminated

Put a => Put (NullTerminated a) Source #

Serialization of null-terminated data may be defined generally using the data's underlying serializer.

Instance details

Defined in Binrep.Type.NullTerminated

class NullCheck a where Source #

Methods

hasNoNulls :: a -> Bool Source #

Instances

Instances details
NullCheck ByteString Source # 
Instance details

Defined in Binrep.Type.NullTerminated