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
- Chem::FormatReader::Indexable(T)
- Chem::Mol2::Reader
- Chem::PDB::Reader
- Chem::SDF::Reader
- Chem::XYZ::Reader
Defined in:
chem/format_reader.crInstance Method Summary
-
#each(indexes : Enumerable(Int), & : T -> )
Yields entries at the specified indexes in the IO to the given block.
-
#each(& : T -> ) : Nil
Yields each entry in the IO to the given block.
-
#next_entry : T | Nil
Returns the next entry in the IO, or
nil
if there are no more entries. -
#read_entry : T
Returns the next entry in the IO.
-
#skip_entry : Nil
Discards the next entry in the IO without fully parsing it.
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.
def read_entry : T
#
Returns the next entry in the IO. Raises ParseException
if there
are no more entries.