![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include <string.h>
Public Member Functions | |
| LineReader (std::span< const std::byte > buffer, size_t max_line_length) | |
| std::optional< std::string > | ReadLine () |
| Returns a string from current iterator position up to (but not including) next and advances iterator to the character following the on success. More... | |
| std::string | ReadLength (size_t len) |
| Returns string from current iterator position of specified length if possible and advances iterator on success. More... | |
| size_t | Remaining () const |
| Returns remaining size of bytes in buffer. More... | |
Public Attributes | |
| const std::span< conststd::byte >::iterator | start |
| const std::span< conststd::byte >::iterator | end |
| const size_t | max_line_length |
| std::span< conststd::byte >::iterator | it |
|
explicit |
Definition at line 17 of file string.cpp.
| std::string util::LineReader::ReadLength | ( | size_t | len | ) |
Returns string from current iterator position of specified length if possible and advances iterator on success.
May exceed max_line_length but will not read past end of buffer.
| [in] | len | The number of bytes to read from the buffer |
| a | std::runtime_error if there is not enough data in the buffer. |
Definition at line 57 of file string.cpp.
| std::optional< std::string > util::LineReader::ReadLine | ( | ) |
Returns a string from current iterator position up to (but not including) next
and advances iterator to the character following the
on success.
Will not return a line longer than max_line_length.
| a | std::runtime_error if max_line_length + 1 bytes are read without finding . |
Definition at line 20 of file string.cpp.
| size_t util::LineReader::Remaining | ( | ) | const |
Returns remaining size of bytes in buffer.
Definition at line 66 of file string.cpp.
| const std::span<conststd::byte>::iterator util::LineReader::end |
| const std::span<conststd::byte>::iterator util::LineReader::start |