FixedLengthUtil::FixedLengthAbstractWriter Class Reference

Structured abstract writer for fixed-length lines. More...

Inheritance diagram for FixedLengthUtil::FixedLengthAbstractWriter:
[legend]

## Public Member Functions

bool | checkTransition (*string from, *string to)
| A verification function to be called for each line. This method can be overridden to achieve a begin-to-end validation of the whole input file. More...
| constructor (hash specs, *hash opts)
| creates the FixedLengthAbstractWriter object More...
string | formatLine (hash line)
| Formats a single line from a hash describing the record type and its contents. More...
int | linesCount ()
| get processed lines count

## Detailed Description

Structured abstract writer for fixed-length lines.

## Member Function Documentation

## checkTransition()

bool FixedLengthUtil::FixedLengthAbstractWriter::checkTransition | ( | *string | from,
|  | *string | to
| ) |  |

A verification function to be called for each line. This method can be overridden to achieve a begin-to-end validation of the whole input file.

Parameters

  from | Type of previous line being processed
  to | Type of the current line being processed

## constructor()

FixedLengthUtil::FixedLengthAbstractWriter::constructor | ( | hash | specs,
|  | *hash | opts
| ) |  |

creates the FixedLengthAbstractWriter object

Parameters

  specs | Fixed-length line specification; see Specification Hash for more information
  opts | Global options; see Global Options for valid values

## formatLine()

string FixedLengthUtil::FixedLengthAbstractWriter::formatLine | ( | hash | line | ) |

Formats a single line from a hash describing the record type and its contents.

Parameters

  line

  a hash describing the record to be formatted; the hash must have the following keys:
  - `"type"`: a string giving the record type (must be defined in Specification Hash given in the constructor)
  - `"record"`: a hash giving the input record to be rendered (with keys as defined in the Record Description Hash for the record identified by the type argument)

Exceptions

  INVALID-LINE-DATA | line argument missing either type or record keys
  INVALID-RECORD | record name (type key in the record hash) not recognized
  FIELD-INPUT-ERROR | the input value is too large to render into the output field
  RECORD-TRANSITION-ERROR | a record transition error occurred; an invalid record sequence was given in the input data