isobmff-builder-0.11.3.0: A (bytestring-) builder for the ISO-14496-12 base media file format

Safe HaskellNone
LanguageHaskell2010

Data.Type.BitRecords.Builder.LazyByteStringBuilder

Contents

Synopsis

Documentation

bitBuilderBox :: forall record. BitStringBuilderHoley (Proxy record) BuilderBox => Proxy record -> ToBitStringBuilder (Proxy record) BuilderBox Source #

Create a Builder from a BitRecord and store it in a BuilderBox

wrapBitBuilderBox :: forall record wrapped. BitStringBuilderHoley (Proxy record) wrapped => (BuilderBox -> wrapped) -> Proxy record -> ToBitStringBuilder (Proxy record) wrapped Source #

Like bitBuilderBox, but runHoley the result and accept as an additional parameter a wrapper function to wrap the final result (the BuilderBox) and runHoley the whole machiner.

bitBuilderBoxHoley :: forall record r. BitStringBuilderHoley (Proxy record) r => Proxy record -> Holey BuilderBox r (ToBitStringBuilder (Proxy record) r) Source #

Create a Builder from a BitRecord and store it in a BuilderBox; return a Holey monoid that does that on runHoley

Low-level interface to building BitRecords and other things

flushBitStringBuilder :: BitStringBuilderState -> BitStringBuilderState Source #

Write the partial buffer contents using any number of word8 The unwritten parts of the bittr buffer are at the top. If the

    63  ...  (63-off-1)(63-off)  ...  0
    ^^^^^^^^^^^^^^^^^^^
Relevant bits start to the top!

appendBitString :: BitString -> BitStringBuilder Source #

Write all the bits, in chunks, filling and writing the BitString in the BitStringBuilderState as often as necessary.

appendStrictByteString :: ByteString -> BitStringBuilder Source #

Write all the b*y*tes, into the BitStringBuilderState this allows general purposes non-byte aligned builders.

BitString construction from BitRecords

class BitStringBuilderHoley a r where Source #

Minimal complete definition

bitStringBuilderHoley

Associated Types

type ToBitStringBuilder a r Source #

Instances

BitStringBuilderHoley BitString r Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Bool * Bool 1 MkFieldFlag) -> Type) (MkField Bool * Bool 1 MkFieldFlag)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Int8 * SignedNat 8 MkFieldI8) -> Type) (MkField Int8 * SignedNat 8 MkFieldI8)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Int16 * SignedNat 16 MkFieldI16) -> Type) (MkField Int16 * SignedNat 16 MkFieldI16)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Int32 * SignedNat 32 MkFieldI32) -> Type) (MkField Int32 * SignedNat 32 MkFieldI32)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Int64 * SignedNat 64 MkFieldI64) -> Type) (MkField Int64 * SignedNat 64 MkFieldI64)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Word8 * Nat 8 MkFieldU8) -> Type) (MkField Word8 * Nat 8 MkFieldU8)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Word16 * Nat 16 MkFieldU16) -> Type) (MkField Word16 * Nat 16 MkFieldU16)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Word32 * Nat 32 MkFieldU32) -> Type) (MkField Word32 * Nat 32 MkFieldU32)) a Source # 
BitStringBuilderHoley (Proxy (A Type (BitRecordField Word64 * Nat 64 MkFieldU64) -> Type) (MkField Word64 * Nat 64 MkFieldU64)) a Source # 
(KnownNat v, BitStringBuilderHoley (Proxy (IsA Type (BitRecordField rt * SignedNat size t)) f) a, (~) * (ToBitStringBuilder (Proxy (IsA Type (BitRecordField rt * SignedNat size t)) f) a) (x -> a), Num x) => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt * SignedNat size t) -> Type) ((:=) rt size SignedNat t f (NegativeNat v))) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt * SignedNat size t) -> Type) ((:=) rt size SignedNat t f (NegativeNat v))) a :: * Source #

(KnownNat v, BitStringBuilderHoley (Proxy (IsA Type (BitRecordField rt * SignedNat size t)) f) a, (~) * (ToBitStringBuilder (Proxy (IsA Type (BitRecordField rt * SignedNat size t)) f) a) (x -> a), Num x) => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt * SignedNat size t) -> Type) ((:=) rt size SignedNat t f (PositiveNat v))) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt * SignedNat size t) -> Type) ((:=) rt size SignedNat t f (PositiveNat v))) a :: * Source #

(KnownNat v, BitStringBuilderHoley (Proxy (IsA Type (BitRecordField rt * Nat len t)) f) a, (~) * (ToBitStringBuilder (Proxy (IsA Type (BitRecordField rt * Nat len t)) f) a) (rt -> a), Num rt) => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt * Nat len t) -> Type) ((:=) rt len Nat t f v)) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Nat len t) -> Type) ((:=) rt len Nat t f v)) a :: * Source #

Methods

bitStringBuilderHoley :: Proxy (A Type (BitRecordField rt * Nat len t) -> Type) ((rt := len) Nat t f v) -> Holey BitStringBuilder a (ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Nat len t) -> Type) ((rt := len) Nat t f v)) a) Source #

(~) Nat (BitRecordFieldSize rt * Bool size t f) 1 => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((:=) rt size Bool t f False)) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((:=) rt size Bool t f False)) a :: * Source #

Methods

bitStringBuilderHoley :: Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((rt := size) Bool t f False) -> Holey BitStringBuilder a (ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((rt := size) Bool t f False)) a) Source #

(~) Nat (BitRecordFieldSize rt * Bool size t f) 1 => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((:=) rt size Bool t f True)) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((:=) rt size Bool t f True)) a :: * Source #

Methods

bitStringBuilderHoley :: Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((rt := size) Bool t f True) -> Holey BitStringBuilder a (ToBitStringBuilder (Proxy (A Type (BitRecordField rt * Bool size t) -> Type) ((rt := size) Bool t f True)) a) Source #

BitStringBuilderHoley (Proxy (IsA Type (BitRecordField rt k st len t)) nested) a => BitStringBuilderHoley (Proxy (A Type (BitRecordField rt k st len t) -> Type) (LabelF rt k st len t l nested)) a Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField rt k st len t) -> Type) (LabelF rt k st len t l nested)) a :: * Source #

Methods

bitStringBuilderHoley :: Proxy (A Type (BitRecordField rt k st len t) -> Type) (LabelF rt k st len t l nested) -> Holey BitStringBuilder a (ToBitStringBuilder (Proxy (A Type (BitRecordField rt k st len t) -> Type) (LabelF rt k st len t l nested)) a) Source #

KnownChunkSize s => BitStringBuilderHoley (Proxy (A Type (BitRecordField (B s) * Nat s (MkFieldBits s)) -> Type) (MkField (B s) * Nat s (MkFieldBits s))) a Source # 
KnownChunkSize size => BitStringBuilderHoley (Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) (MkField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size))) r Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) (MkField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size))) r :: * Source #

(KnownNat (FromEnum e v), KnownChunkSize size) => BitStringBuilderHoley (Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) ((:=) (EnumValue e) size e (MkFieldCustom * (EnumValue e) e size) f v)) r Source # 

Associated Types

type ToBitStringBuilder (Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) ((:=) (EnumValue e) size e (MkFieldCustom * (EnumValue e) e size) f v)) r :: * Source #

Methods

bitStringBuilderHoley :: Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) ((EnumValue e := size) e (MkFieldCustom * (EnumValue e) e size) f v) -> Holey BitStringBuilder r (ToBitStringBuilder (Proxy (A Type (BitRecordField (EnumValue e) * e size (MkFieldCustom * (EnumValue e) e size)) -> Type) ((EnumValue e := size) e (MkFieldCustom * (EnumValue e) e size) f v)) r) Source #

BitStringBuilderHoley (Proxy BitRecord (Eval BitRecord r)) a => BitStringBuilderHoley (Proxy (IsA * BitRecord) r) a Source # 
BitStringBuilderHoley (Proxy BitRecord EmptyBitRecord) a Source # 
BitStringBuilderHoley (Proxy (IsA Type (BitRecordField rt k st len t)) f) a => BitStringBuilderHoley (Proxy BitRecord (BitRecordMember rt k st len t f)) a Source # 

Associated Types

type ToBitStringBuilder (Proxy BitRecord (BitRecordMember rt k st len t f)) a :: * Source #

(BitStringBuilderHoley (Proxy BitRecord l) (ToBitStringBuilder (Proxy BitRecord r) a), BitStringBuilderHoley (Proxy BitRecord r) a) => BitStringBuilderHoley (Proxy BitRecord (BitRecordAppend l r)) a Source # 

BitRecordField instances

Labbeled Fields

Bool

Bits

Naturals

Signed

BitRecord instances

BitRecordMember

AppendedBitRecords

EmptyBitRecord and '...Pretty'

Tracing/Debug Printing

printBuilder :: Builder -> String Source #

Print a Builder to a space seperated series of hexa-decimal bytes.