class Chem::DCD::Reader

Overview

Implementation based on Chemfiles C++ library.

Included Modules

Defined in:

chem/formats/dcd.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Chem::FormatReader::Indexable(Chem::Structure)

entry_index : Int32 entry_index, n_entries : Int32 n_entries, next_entry : T | Nil next_entry, read_entry(index : Int) : T read_entry, skip_entry : Nil skip_entry, skip_to_entry(index : Int) : Nil skip_to_entry

Instance methods inherited from module Chem::FormatReader::MultiEntry(Chem::Structure)

each(indexes : Enumerable(Int), & : T -> )
each(& : T -> ) : Nil
each
, next_entry : T | Nil next_entry, read_entry : T read_entry, skip_entry : Nil skip_entry

Instance methods inherited from module Chem::FormatReader(Chem::Structure)

read? : Bool read?, read_entry : T read_entry

Instance methods inherited from module IO::Wrapper

close close, closed? : Bool closed?, sync_close : Bool sync_close, sync_close=(sync_close : Bool) sync_close=

Constructor Detail

def self.new(io : IO, structure : Structure, reuse : Bool = false, sync_close : Bool = false) #

[View source]
def self.new(path : Path | String, structure : Structure, reuse : Bool = false) : self #

Creates a new object from the given path. Positional and named arguments are forwarded to the designated constructor.

An IO object will be created and open from the given path, which will be closed when closing this object (sync_close = true). The file open mode is specified by the FILE_MODE constant.


Class Method Detail

def self.open(io : IO, structure : Structure, reuse : Bool = false, sync_close : Bool = false, & : self -> ) #

Creates a new object from the given io, yields it to the given block, and closes it at the end. Positional and named arguments are forwarded to the constructor.


def self.open(path : Path | String, structure : Structure, reuse : Bool = false, & : self -> ) #

Creates a new object from the given path yields it to the given block, and closes it at the end. Positional and named arguments are forwarded to the constructor.

An IO object will be created and open from the given path, which will be closed when closing this object (sync_close = true). The file open mode is specified by the FILE_MODE constant.


Instance Method Detail

def entry_index : Int32 #
Description copied from module Chem::FormatReader::Indexable(Chem::Structure)

Returns the index of the current entry.


[View source]
def n_entries : Int32 #
Description copied from module Chem::FormatReader::Indexable(Chem::Structure)

Returns the number of entries in the IO.


[View source]
def skip_to_entry(index : Int) : Nil #
Description copied from module Chem::FormatReader::Indexable(Chem::Structure)

Discards the entries (without parsing) up until the given index. Raises IndexError if the index is invalid.


[View source]