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

#include <nuri/fmt/base.h>

Public Member Functions

template<class... Args>
 MoleculeReaderWrapper (std::string_view fmt, Args &&...args)
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()

template<class SourceStream, class Reader = MoleculeReader>
template<class... Args>
nuri::MoleculeReaderWrapper< SourceStream, Reader >::MoleculeReaderWrapper ( std::string_view fmt,
Args &&... args )
inline

Member Function Documentation

◆ getnext()

template<class SourceStream, class Reader = MoleculeReader>
bool nuri::MoleculeReaderWrapper< SourceStream, 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 SourceStream, class Reader = MoleculeReader>
std::vector< std::string > nuri::MoleculeReaderWrapper< SourceStream, 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 SourceStream, class Reader = MoleculeReader>
nuri::MoleculeReaderWrapper< SourceStream, Reader >::operator bool ( ) const
inline

◆ parse()

template<class SourceStream, class Reader = MoleculeReader>
Molecule nuri::MoleculeReaderWrapper< SourceStream, 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 SourceStream, class Reader = MoleculeReader>
MoleculeStream< Reader > nuri::MoleculeReaderWrapper< SourceStream, Reader >::stream ( )
inline

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