|
Collective Variables Module - Developer Documentation
|
#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_stream & | operator>> (cvm::memory_stream &is, read_block const &rb) |
| Read block from stream, first check that key matches, then call read_contents() | |
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
|
private |
Read the contents of a formatted block after checking that the keyword matches
| [in] | is | Stream object |
| [in] | block_only | If true, stream is assumed to contain only the block without braces |