NuriKit v0.1.0b2
Loading...
Searching...
No Matches
nuri::MoleculeReaderWrapper< std::ifstream, Reader > Class Template Reference

#include <nuri/fmt/base.h>

Public Member Functions

 MoleculeReaderWrapper (const std::filesystem::path &path)
 MoleculeReaderWrapper (std::string_view fmt, const std::filesystem::path &path)
std::vector< std::string > next ()
 Advance the stream to the next molecule.
bool getnext (std::vector< std::string > &block)
 Advance the reader to the next molecule.
Molecule parse (const std::vector< std::string > &block) const
 Parse the current block and return the molecule.
MoleculeStream< Reader > stream ()
 operator bool () const

Constructor & Destructor Documentation

◆ MoleculeReaderWrapper() [1/2]

template<class Reader>
nuri::MoleculeReaderWrapper< std::ifstream, Reader >::MoleculeReaderWrapper ( const std::filesystem::path & path)
inlineexplicit

◆ MoleculeReaderWrapper() [2/2]

template<class Reader>
nuri::MoleculeReaderWrapper< std::ifstream, Reader >::MoleculeReaderWrapper ( std::string_view fmt,
const std::filesystem::path & path )
inline

Member Function Documentation

◆ getnext()

template<class Reader>
bool nuri::MoleculeReaderWrapper< std::ifstream, Reader >::getnext ( std::vector< std::string > & block)
inline

Advance the reader to the next molecule.

Parameters
blockThe block containing the next molecule. If true is returned, pre-existing contents of the block are discarded. Otherwise, the block is in a valid but unspecified state.
Returns
true if the reader has successfully advanced to the next molecule, false otherwise.

◆ next()

template<class Reader>
std::vector< std::string > nuri::MoleculeReaderWrapper< std::ifstream, Reader >::next ( )
inline

Advance the stream to the next molecule.

Returns
The next block containing the next molecule. If the stream is at the end, an empty block is returned.

◆ operator bool()

template<class Reader>
nuri::MoleculeReaderWrapper< std::ifstream, Reader >::operator bool ( ) const
inline

◆ parse()

template<class Reader>
Molecule nuri::MoleculeReaderWrapper< std::ifstream, Reader >::parse ( const std::vector< std::string > & block) const
inline

Parse the current block and return the molecule.

Parameters
blockThe block to parse.
Returns
The current molecule.
Note
The returned molecule will be empty if the block is empty.

◆ stream()

template<class Reader>
MoleculeStream< Reader > nuri::MoleculeReaderWrapper< std::ifstream, Reader >::stream ( )
inline

The documentation for this class was generated from the following file: