Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xstream::digest::stream Class Referenceabstract

#include <digest.h>

+ Inheritance diagram for xstream::digest::stream:

Protected Member Functions

int sync ()
 update digest with as much data as possible (overloaded from streambuf) More...
 
 stream (size_t len)
 default constructor More...
 
virtual void calculate_digest ()=0
 updates the digest must be inplemented by classes that implement this interface More...
 
virtual void reset_digest ()=0
 resets digest to it's initial value More...
 
 ~stream ()
 
std::streamsize available () const
 remaining characters in the buffer More...
 
std::streamsize taken () const
 number of characters in the buffer More...
 

Protected Attributes

xstream::buffer buf
 
uint64_t length
 

Private Member Functions

int overflow (int c)
 write a character that surpasses buffer end (overloaded from streambuf) More...
 
std::streamsize xsputn (const char *buffer, std::streamsize n)
 add an entire buffer to digest calculation (overloaded from streambuf) More...
 

Detailed Description

Definition at line 36 of file digest.h.

Constructor & Destructor Documentation

xstream::digest::stream::stream ( size_t  len)
protected

default constructor

allocates the buffer

len length of buffer

Definition at line 14 of file digest.cpp.

References xstream::buffer::buf, buf, LOG, and xstream::buffer::size.

xstream::digest::stream::~stream ( )
protected

destructor

frees the buffer

Definition at line 21 of file digest.cpp.

References LOG.

Member Function Documentation

std::streamsize xstream::ostreambuf::available ( ) const
inlineprotectedinherited

remaining characters in the buffer

Definition at line 28 of file common.h.

Referenced by xstream::base64::ostreambuf::~ostreambuf().

virtual void xstream::digest::stream::calculate_digest ( )
protectedpure virtual

updates the digest must be inplemented by classes that implement this interface

Referenced by sync().

int xstream::digest::stream::overflow ( int  c)
private

write a character that surpasses buffer end (overloaded from streambuf)

Definition at line 37 of file digest.cpp.

References c, xstream::digest::eof, LOG, and sync().

virtual void xstream::digest::stream::reset_digest ( )
protectedpure virtual

resets digest to it's initial value

Referenced by xstream::digest::common< digest_type >::reset().

int xstream::digest::stream::sync ( )
protected

update digest with as much data as possible (overloaded from streambuf)

Definition at line 26 of file digest.cpp.

References xstream::buffer::buf, buf, calculate_digest(), length, LOG, and xstream::buffer::size.

Referenced by overflow(), xstream::digest::common< digest_type >::reset(), and xsputn().

std::streamsize xstream::ostreambuf::taken ( ) const
inlineprotectedinherited

number of characters in the buffer

Definition at line 36 of file common.h.

Referenced by xsputn().

std::streamsize xstream::digest::stream::xsputn ( const char *  buffer,
std::streamsize  n 
)
private

add an entire buffer to digest calculation (overloaded from streambuf)

Definition at line 52 of file digest.cpp.

References LOG, sync(), and xstream::ostreambuf::taken().

Member Data Documentation

xstream::buffer xstream::digest::stream::buf
protected

buffer data to calculate digest

Definition at line 59 of file digest.h.

Referenced by stream(), and sync().

uint64_t xstream::digest::stream::length
protected

number of bytes read so far

Definition at line 60 of file digest.h.

Referenced by sync().


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