sprint 1-alpha
Public Member Functions
sprint::read_buffer< T > Class Template Reference

#include <bufferize.h>

List of all members.

Public Member Functions

template<class P >
 read_buffer (const P &p, int capacity)
 costructor with inner IO object and buffer capacity
 read_buffer (int capacity)
 costructor with only buffer capacity
bool valid () const
 test if buffer is initialized and stream valid
int remain () const
 debug function: return the number of bytes in queue
int readsome (unsigned char *dst, int len)
int read (unsigned char *dst, int len)
 Read buffered data.
int skip (int n)
int peek ()
 Read a single byte but not remove from buffer.
int get ()
 Read a single byte.

Detailed Description

template<class T>
class sprint::read_buffer< T >

class to bufferize reading (this class add buffer capabilities to IO class) T should have a method

 T::read(unsigned char *dst, int size);

Example:


Member Function Documentation

template<class T>
int sprint::read_buffer< T >::readsome ( unsigned char *  dst,
int  len 
)

non blocking read

Returns:
il numero di byte copiati. ritorna sempre un valore >=0

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines