seasonder_readCSSWHeader {SeaSondeR}R Documentation

Read CSSW File Header

Description

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

Usage

seasonder_readCSSWHeader(
  connection,
  current_specs,
  endian = "big",
  parent_key = NULL,
  keys_so_far = c("CSSW", "HEAD"),
  specs_key_size = NULL
)

Arguments

connection

A binary connection from which to read the CSSW 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("CSSW", "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_readCSSWFields.

The function processes the CSSW header recursively:

Value

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


[Package SeaSondeR version 0.2.8 Index]