Saucexages v0.2.0 Saucexages.Codec.Encoder View Source

Functions for encoding SAUCE blocks as binary.

Link to this section Summary

Functions

Encodes a single comment block line. If the size of the line is longer than allowed, it will be truncated

Encodes an entire comment block. If the size of any line is longer than allowed, it will be truncated

Encodes a C-style string for SAUCE using CP437, padding as needed with zeros according to size

Encodes an elixir date time as a SAUCE date time binary in the format “CCMMYYDD”

Encodes a given SAUCE block field

Encodes an integer to a given size as an unsigned little integer. If the integer is larger than the size allows, it will wrap

Encodes a given SAUCE block as a SAUCE record binary

Encodes a string for SAUCE using CP437, padding as needed with spaces according to size

Encodes the SAUCE version

Link to this section Functions

Link to this function encode_comment_block_line(comment) View Source
encode_comment_block_line(String.t()) :: binary()

Encodes a single comment block line. If the size of the line is longer than allowed, it will be truncated.

Link to this function encode_comments(sauce_block) View Source
encode_comments(Saucexages.SauceBlock.t()) :: {:ok, binary()} | {:error, term()}

Encodes an entire comment block. If the size of any line is longer than allowed, it will be truncated.

Link to this function encode_cstring(string, size) View Source
encode_cstring(String.t(), pos_integer()) :: binary()

Encodes a C-style string for SAUCE using CP437, padding as needed with zeros according to size.

Link to this function encode_date(map) View Source
encode_date(DateTime.t()) :: binary()

Encodes an elixir date time as a SAUCE date time binary in the format “CCMMYYDD”.

Link to this function encode_field(field_id, sauce_block) View Source

Encodes a given SAUCE block field.

Link to this function encode_integer(value, size) View Source
encode_integer(non_neg_integer(), pos_integer()) :: binary()

Encodes an integer to a given size as an unsigned little integer. If the integer is larger than the size allows, it will wrap.

Link to this function encode_record(sauce_block) View Source
encode_record(Saucexages.SauceBlock.t()) :: {:ok, binary()}

Encodes a given SAUCE block as a SAUCE record binary.

Link to this function encode_string(string, size) View Source
encode_string(String.t(), pos_integer()) :: binary()

Encodes a string for SAUCE using CP437, padding as needed with spaces according to size.

Link to this function encode_version(version) View Source
encode_version(String.t()) :: binary()

Encodes the SAUCE version.