module Chem::FormatReader::Headed(T)

Overview

Declares a common interface for reading the header information encoded in a file format. This is useful for cases when a file format includes valuable information (by itself) in the header.

Including types must implement the #decode_header : T protected method, where the type variable T indicates the header type. Upon parsing issues, including types are expected to raise a ParseException exception.

Direct including types

Defined in:

chem/format_reader.cr

Instance Method Summary

Instance Method Detail

def read_header : T #

Reads the header object from the IO. Raises IO::Error if the reader is closed or ParseException if the header cannot be decoded.


[View source]