Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
colvarparse::read_block Class Reference

#include <colvarparse.h>

Public Member Functions

 read_block (std::string const &key, std::string *data=nullptr)
 

Private Member Functions

std::istream & read_block_contents (std::istream &is, bool block_only=false) const
 

Private Attributes

std::string const key
 Keyword that identifies the block.
 
std::string *const data
 Where to keep the data.
 

Friends

std::istream & operator>> (std::istream &is, read_block const &rb)
 Read block from stream, first check that key matches, then call read_contents()
 
cvm::memory_streamoperator>> (cvm::memory_stream &is, read_block const &rb)
 Read block from stream, first check that key matches, then call read_contents()
 

Detailed Description

Helper class to read a block "key { ... }" from a stream and store it in a string

Useful on restarts, where the file is too big to be loaded in a string by key_lookup(); it can only check that the keyword is correct and the block is properly delimited by braces, not skipping other blocks

Member Function Documentation

◆ read_block_contents()

std::istream & colvarparse::read_block::read_block_contents ( std::istream &  is,
bool  block_only = false 
) const
private

Read the contents of a formatted block after checking that the keyword matches

Parameters
[in]isStream object
[in]block_onlyIf true, stream is assumed to contain only the block without braces

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