module Chem::FormatReader::MultiEntry(T)

Overview

Declares a common interface for reading an indeterminate number of objects encoded in a file format.

Including types must implement the #skip_entry method to discard the next entry in the IO.

Direct including types

Defined in:

chem/format_reader.cr

Instance Method Summary

Instance Method Detail

def each(indexes : Enumerable(Int), & : T -> ) #

Yields entries at the specified indexes in the IO to the given block. Raises IndexError when an index is out of bounds.


[View source]
def each(& : T -> ) : Nil #

Yields each entry in the IO to the given block.


[View source]
def next_entry : T | Nil #

Returns the next entry in the IO, or nil if there are no more entries.


[View source]
def read_entry : T #

Returns the next entry in the IO. Raises ParseException if there are no more entries.


[View source]
abstract def skip_entry : Nil #

Discards the next entry in the IO without fully parsing it.


[View source]