BashSpark
Loading...
Searching...
No Matches
bs::basic_nullbuffer< char_t, traits_t > Class Template Reference

A null stream buffer that ignores all input and output. More...

#include <nullstream.h>

Inheritance diagram for bs::basic_nullbuffer< char_t, traits_t >:
Collaboration diagram for bs::basic_nullbuffer< char_t, traits_t >:

Public Types

using char_type = std::basic_istream< char_t, traits_t >::char_type
 Character type of the buffer.
 
using traits_type = std::basic_istream< char_t, traits_t >::traits_type
 Character traits of the buffer.
 
using int_type = std::basic_istream< char_t, traits_t >::int_type
 Integer type representing characters.
 

Public Member Functions

std::streamsize xsgetn (char_t *s, std::streamsize n) override
 Gets a number of characters from the stream.
 
std::streamsize xsputn (const char_t *s, std::streamsize n) override
 Puts a number of characters into the stream.
 

Detailed Description

template<typename char_t, typename traits_t>
class bs::basic_nullbuffer< char_t, traits_t >

A null stream buffer that ignores all input and output.

This class provides a basic implementation of std::basic_streambuf that does not store or react to any data.

Template Parameters
char_tThe character type.
traits_tThe traits type for the character type.

Member Function Documentation

◆ xsgetn()

template<typename char_t , typename traits_t >
std::streamsize bs::basic_nullbuffer< char_t, traits_t >::xsgetn ( char_t *  s,
std::streamsize  n 
)
inlineoverride

Gets a number of characters from the stream.

Parameters
sPointer to the buffer where characters will be stored.
nThe number of characters to get.
Returns
Always returns 0 since this is a null buffer.

◆ xsputn()

template<typename char_t , typename traits_t >
std::streamsize bs::basic_nullbuffer< char_t, traits_t >::xsputn ( const char_t *  s,
std::streamsize  n 
)
inlineoverride

Puts a number of characters into the stream.

Parameters
sPointer to the buffer containing characters to put.
nThe number of characters to put.
Returns
Always returns 0 since this is a null buffer.

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