seasonder_readCSSYHeader {SeaSondeR}R Documentation

Read CSSY File Header

Description

This function reads the header section of a CSSY file from a binary connection. The CSSY file header contains a set of key blocks formatted according to the SeaSonde CSSY specification. The header section is processed recursively and terminates when one of the following conditions is met:

Usage

seasonder_readCSSYHeader(
  connection,
  current_specs,
  endian = "big",
  parent_key = NULL,
  keys_so_far = c("CSSY", "HEAD"),
  specs_key_size = NULL
)

Arguments

connection

A binary connection from which to read the CSSY file header.

current_specs

A list representing the specification for the header; may contain nested subkeys.

endian

A character string indicating the byte order for reading numeric values ("big" or "little").

parent_key

(Optional) A list with information from the parent key block, used when processing nested keys.

keys_so_far

A character vector of keys already processed, used to avoid recursive loops. Defaults to c("CSSY", "HEAD").

specs_key_size

A specification for reading the key size block, often obtained from YAML specs.

Details

When no subkeys are specified in current_specs (i.e. current_specs comprises only simple field definitions), the function delegates the processing to seasonder_readCSSYFields.

The function processes the CSSY header recursively:

Value

A list containing the parsed CSSY header information. The returned list may be empty if a termination condition is encountered.


[Package SeaSondeR version 0.2.8 Index]