dconv 2.0
C++14 library for printing and parsing floating point numbers
Loading...
Searching...
No Matches
dconv::StreamProbe Class Reference

stream probe. More...

#include <probe.hpp>

Public Member Functions

 StreamProbe (std::istream &in)
 default constructor.
 
 StreamProbe (const StreamProbe &other)=delete
 copy constructor.
 
StreamProbe & operator= (const StreamProbe &other)=delete
 copy assignment.
 
 StreamProbe (StreamProbe &&other)=delete
 move constructor.
 
StreamProbe & operator= (StreamProbe &&other)=delete
 move assignment.
 
 ~StreamProbe ()=default
 destroy instance.
 
int peek () const noexcept
 get character without extracting it.
 
int get () noexcept
 extracts character.
 
bool getIf (char expected) noexcept
 extracts expected character.
 
bool getIfNoCase (char expected) noexcept
 extracts expected character (case insensitive, ASCII-only).
 
size_t readDigits (uint64_t &value, size_t max=std::numeric_limits< size_t >::max()) noexcept
 read consecutive digits.
 
size_t read (char *buf, size_t count) noexcept
 read characters.
 

Detailed Description

stream probe.

Constructor & Destructor Documentation

◆ StreamProbe() [1/3]

dconv::StreamProbe::StreamProbe ( std::istream & in)
inlineexplicit

default constructor.

Parameters
ininput stream.

◆ StreamProbe() [2/3]

dconv::StreamProbe::StreamProbe ( const StreamProbe & other)
delete

copy constructor.

Parameters
otherobject to copy.

◆ StreamProbe() [3/3]

dconv::StreamProbe::StreamProbe ( StreamProbe && other)
delete

move constructor.

Parameters
otherobject to move.

◆ ~StreamProbe()

dconv::StreamProbe::~StreamProbe ( )
default

destroy instance.

Member Function Documentation

◆ get()

int dconv::StreamProbe::get ( )
inlinenoexcept

extracts character.

Returns
extracted character.

◆ getIf()

bool dconv::StreamProbe::getIf ( char expected)
inlinenoexcept

extracts expected character.

Parameters
expectedexpected character.
Returns
true if extracted, false otherwise.

◆ getIfNoCase()

bool dconv::StreamProbe::getIfNoCase ( char expected)
inlinenoexcept

extracts expected character (case insensitive, ASCII-only).

Parameters
expectedexpected character.
Returns
true if extracted, false otherwise.

◆ operator=() [1/2]

StreamProbe & dconv::StreamProbe::operator= ( const StreamProbe & other)
delete

copy assignment.

Parameters
otherobject to copy.
Returns
a reference of the current object.

◆ operator=() [2/2]

StreamProbe & dconv::StreamProbe::operator= ( StreamProbe && other)
delete

move assignment.

Parameters
otherobject to move.
Returns
a reference of the current object.

◆ peek()

int dconv::StreamProbe::peek ( ) const
inlinenoexcept

get character without extracting it.

Returns
extracted character.

◆ read()

size_t dconv::StreamProbe::read ( char * buf,
size_t count )
inlinenoexcept

read characters.

Parameters
bufoutput buffer.
countnumber of characters to read.
Returns
number of characters read.

◆ readDigits()

size_t dconv::StreamProbe::readDigits ( uint64_t & value,
size_t max = std::numeric_limits<size_t>::max () )
inlinenoexcept

read consecutive digits.

Parameters
valuevalue the digits are appended to.
maxmaximum number of digits to read.
Returns
number of digits read.

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