module

Chem::FormatReader::MultiEntry(T)

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.

Instance methods

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.

Source
each

Yields each entry in the IO to the given block.

Source
next_entry

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

Source
read_entry

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

Source
skip_entry

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

Source