MPD: BufferedReader Class Reference

MPD 0.20.15

Public Member Functions
BufferedReader Class Reference

`#include <BufferedReader.hxx>`

## Public Member Functions
| BufferedReader (Reader &_reader)
void | Reset () noexcept
| Reset the internal state. More...
bool | Fill (bool need_more)
gcc_pure WritableBuffer< void > | Read () const noexcept
void * | ReadFull (size_t size)
| Read a buffer of exactly the given size (without consuming it). More...
void | Consume (size_t n) noexcept
size_t | ReadFromBuffer (WritableBuffer< void > dest) noexcept
| Read (and consume) data from the input buffer into the given buffer. More...
void | ReadFull (WritableBuffer< void > dest)
| Read data into the given buffer and consume it from our buffer. More...
char * | ReadLine ()
unsigned | GetLineNumber () const noexcept

## Detailed Description

Definition at line 31 of file BufferedReader.hxx.

## Constructor & Destructor Documentation

## ◆ BufferedReader()

BufferedReader::BufferedReader | ( | Reader & | _reader | ) |
| inlineexplicit

Definition at line 43 of file BufferedReader.hxx.

## Member Function Documentation

## ◆ Consume()

void BufferedReader::Consume | ( | size_t | n | ) |
| inlinenoexcept

Definition at line 70 of file BufferedReader.hxx.

## ◆ Fill()

bool BufferedReader::Fill | ( | bool | need_more | ) |

## ◆ GetLineNumber()

unsigned BufferedReader::GetLineNumber | ( |  | ) | const
| inlinenoexcept

Definition at line 89 of file BufferedReader.hxx.

## ◆ Read()

gcc_pure WritableBuffer<void> BufferedReader::Read | ( |  | ) | const
| inlinenoexcept

Definition at line 59 of file BufferedReader.hxx.

## ◆ ReadFromBuffer()

size_t BufferedReader::ReadFromBuffer | ( | WritableBuffer< void > | dest | ) |
| noexcept

Read (and consume) data from the input buffer into the given buffer.

Does not attempt to refill the buffer.

## ◆ ReadFull() [1/2]

void* BufferedReader::ReadFull | ( | size_t | size | ) |

Read a buffer of exactly the given size (without consuming it).

Throws std::runtime_error if not enough data is available.

## ◆ ReadFull() [2/2]

void BufferedReader::ReadFull | ( | WritableBuffer< void > | dest | ) |

Read data into the given buffer and consume it from our buffer.

Throw an exception if the request cannot be forfilled.

## ◆ ReadLine()

char* BufferedReader::ReadLine | ( |  | ) |

## ◆ Reset()

void BufferedReader::Reset | ( |  | ) |
| inlinenoexcept

Reset the internal state.

Should be called after rewinding the underlying Reader.

Definition at line 50 of file BufferedReader.hxx.

The documentation for this class was generated from the following file:

- fs/io/BufferedReader.hxx