#include <userver/engine/io/buffered.hpp>
Wrapper for buffered input.
Definition at line 31 of file buffered.hpp.
Public Member Functions | |
BufferedReader (ReadableBasePtr source) | |
Creates a buffered reader with default buffer size. | |
BufferedReader (ReadableBasePtr source, size_t buffer_size) | |
Creates a buffered reader with specified initial buffer size. | |
BufferedReader (BufferedReader &&) noexcept | |
BufferedReader & | operator= (BufferedReader &&) noexcept |
bool | IsValid () const |
Whether the underlying source is valid. | |
std::string | ReadSome (size_t max_bytes, Deadline deadline={}) |
Reads some bytes from the input stream. | |
std::string | ReadAll (size_t num_bytes, Deadline deadline={}) |
Reads the exact number of bytes from the input stream. | |
std::string | ReadLine (Deadline deadline={}) |
Reads a line from the input, skipping empty lines. | |
std::string | ReadUntil (char terminator, Deadline deadline={}) |
Reads the stream until the specified character of EOF is encountered. | |
std::string | ReadUntil (utils::function_ref< bool(int) const > pred, Deadline deadline={}) |
Reads the stream until the predicate returns true . | |
int | Getc (Deadline deadline={}) |
Reads one byte from the stream or reports an EOF (-1). | |
int | Peek (Deadline deadline={}) |
Returns the first byte of the buffer or EOF (-1). | |
void | Discard (size_t num_bytes, Deadline deadline={}) |
Discards the specified number of bytes from the buffer. | |
std::string engine::io::BufferedReader::ReadAll | ( | size_t | num_bytes, |
Deadline | deadline = {} ) |
Reads the exact number of bytes from the input stream.
std::string engine::io::BufferedReader::ReadLine | ( | Deadline | deadline = {} | ) |
Reads a line from the input, skipping empty lines.
std::string engine::io::BufferedReader::ReadUntil | ( | utils::function_ref< bool(int) const > | pred, |
Deadline | deadline = {} ) |
Reads the stream until the predicate returns true
.
pred | predicate that will be called for each byte read and EOF. |