FormatParser.Archive (format_parser v2.6.0)

An Archive struct and functions.

The Archive struct contains the fields format and nature.

Summary

Functions

Parses the given input based on its type.

Types

t()

@type t() :: %FormatParser.Archive{format: any(), intrinsics: map(), nature: atom()}

Functions

parse(file)

@spec parse({:error, binary()} | binary() | any()) :: any()

Parses the given input based on its type.

  • If the input is a tuple {:error, file} where file is a binary, it attempts to parse the file data.
  • If the input is a binary, it parses the file data.
  • For any other input, it returns the input as is.

Examples

iex> parse({:error, "file.txt"}) # Parses the file data

iex> parse("file.txt") # Parses the file data

iex> parse(:ok) :ok