flatbuffers-0.1.0.0: Haskell implementation of the FlatBuffers protocol.

Safe HaskellSafe
LanguageHaskell2010

FlatBuffers.Internal.FileIdentifier

Synopsis

Documentation

class HasFileIdentifier a where Source #

Associates a type with a file identifier. To create an association, declare a root_type and file_identifier in your schema.

table Player {}
root_type Player;
file_identifier "PLYR";

data FileIdentifier Source #

An identifier that's used to "mark" a buffer. To add this marker to a buffer, use encodeWithFileIdentifier. To check whether a buffer contains the marker before decoding it, use checkFileIdentifier.

For more information on file identifiers, see :

fileIdentifier :: Text -> Maybe FileIdentifier Source #

Encodes the input text as UTF-8 and returns a Just FileIdentifier if it has exactly 4 bytes, otherwise Nothing.

fileIdentifier' :: ByteString -> Maybe FileIdentifier Source #

Returns a Just FileIdentifier if the input ByteString has exactly 4 bytes, otherwise Nothing.

unsafeFileIdentifier :: Text -> FileIdentifier Source #

Constructs a new FileIdentifier without checking its length.

unsafeFileIdentifier' :: ByteString -> FileIdentifier Source #

Constructs a new FileIdentifier without checking its length.