Gromacs
2022.2
|
#include <gromacs/utility/filestream.h>
Text input stream implementation for reading from stdin
.
Implementations for the TextInputStream methods throw FileIOError on any I/O error.
Public Member Functions | |
bool | readLine (std::string *line) override |
Reads a line (with newline included) from the stream. More... | |
void | close () override |
Closes the stream. More... | |
Static Public Member Functions | |
static bool | isInteractive () |
Returns whether stdin is an interactive terminal. More... | |
|
inlineoverridevirtual |
Closes the stream.
It is not allowed to read from a stream after it has been closed. See TextOutputStream::close() for rationale for a close() method separate from the destructor. For input, failures during close should be rare, but it is clearer to keep the interface symmetric.
Implements gmx::TextInputStream.
|
static |
Returns whether stdin
is an interactive terminal.
Only works on Unix, otherwise always returns true.
Does not throw.
|
overridevirtual |
Reads a line (with newline included) from the stream.
[out] | line | String to receive the line. |
false
if nothing was read because the stream ended.On error or when false
is returned, line
will be empty.
Implements gmx::TextInputStream.