tahoe-directory-0.1.0.0: Tahoe-LAFS directory-like abstraction for collections of data objects.
Safe HaskellNone
LanguageHaskell2010

Tahoe.Directory.Internal.Parsing

Description

Parsing and serialization for directories and their entries.

Synopsis

Documentation

parse :: ByteString -> Either (ParseErrorBundle ByteString Void) Directory Source #

Parse the serialized form of a directory into a Directory.

type Parser = Parsec Void ByteString Source #

The parser type we will parse in.

natural :: Integral i => Parser i Source #

Parse the base ten representation of a natural number.

pNetstring Source #

Arguments

:: (Int -> Parser a)

A function that takes the length of the string encoded in the netstring and returns a parser for the value the encoded string represents.

-> Parser a

A parser for the value.

Parse a netstring-encoded value, applying a sub-parser to the encoded string.

serialize :: Directory -> ByteString Source #

Serialize a Directory to the canonical bytes representation.

netstring :: ByteString -> ByteString Source #

Encode a bytestring as a netstring.