|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Blocking line-oriented reader built on top of AbstractPipeReader. More...
#include <AbstractPipe.h>
Public Member Functions | |
| PipeScanner (std::shared_ptr< AbstractPipeReader > source) | |
| Construct a PipeScanner from a source reader. | |
| std::string | getLine () |
| Read the next complete line from the pipe. | |
Blocking line-oriented reader built on top of AbstractPipeReader.
PipeScanner provides a convenient way to read complete lines from a pipe. It wraps AbstractPipeReader and handles:
Design Notes:
Thread Safety: Not thread-safe. The source pipe must not be accessed from other threads while getLine() is being called.
Usage Example:
|
inline |
Construct a PipeScanner from a source reader.
| source | Shared pointer to AbstractPipeReader to read from |
| std::string PipeScanner::getLine | ( | ) |
Read the next complete line from the pipe.
| PipeClosedException | if the pipe is closed before a complete line is received |
This method blocks until a complete line (ending with '\n') is received from the pipe. The returned string does not include the newline character.
Blocking Behavior:
Exception Safety: If PipeClosedException is thrown, the pipe is broken and no further getLine() calls should be made.