MPD: PeekReader Class Reference

MPD 0.20.15

Public Member Functions
PeekReader Class Referencefinal

A filter that allows the caller to peek the first few bytes without consuming them. More...

`#include <PeekReader.hxx>`

Inheritance diagram for PeekReader:
[legend]
Collaboration diagram for PeekReader:
[legend]

## Public Member Functions
| PeekReader (Reader &_next)
const void * | Peek (size_t size)
virtual size_t | Read (void *data, size_t size) override
| Read data from the stream. More...
Public Member Functions inherited from Reader
| Reader ()=default
| Reader (const Reader &)=delete

## Detailed Description

A filter that allows the caller to peek the first few bytes without consuming them.

The first call must be Peek(), and the following Read() will deliver the same bytes again.

Definition at line 34 of file PeekReader.hxx.

## Constructor & Destructor Documentation

## ◆ PeekReader()

PeekReader::PeekReader | ( | Reader & | _next | ) |
| inlineexplicit

Definition at line 42 of file PeekReader.hxx.

## Member Function Documentation

## ◆ Peek()

const void* PeekReader::Peek | ( | size_t | size | ) |

## ◆ Read()

virtual size_t PeekReader::Read | ( | void * | data,
|  | size_t | size
| ) |  |
| overridevirtual

Read data from the stream.

Returns
  the number of bytes read into the given buffer or 0 on end-of-stream

Implements Reader.

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

- fs/io/PeekReader.hxx