Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::checksum::Fletcher Class Reference

#include <elm/checksum/Fletcher.h>

Public Member Functions

 Fletcher (void)
 
virtual ~Fletcher (void)
 
t::uint32 sum (void)
 
void put (io::InStream &in)
 
void put (const void *buffer, int length)
 
void put (const CString &str)
 
void put (const String &str)
 
Fletcheroperator<< (const char *str)
 
Fletcheroperator<< (const CString &str)
 
Fletcheroperator<< (const String &str)
 
template<class T >
Fletcheroperator<< (const T &value)
 
virtual int write (const char *buffer, int size)
 
virtual int flush (void)
 
virtual cstring lastErrorMessage (void)
 

Detailed Description

Apply the Fletcher algorithm (http://en.wikipedia.org/wiki/Fletcher%27s_checksum) to compute a checksum.

Data are checksummed calling any one of the put() methods. When all data has been checksummed, the checksum value is returned by sum.

Constructor & Destructor Documentation

elm::checksum::Fletcher::Fletcher ( void  )

Build a new Fletcher checksum builder.

elm::checksum::Fletcher::~Fletcher ( void  )
virtual

Member Function Documentation

int elm::checksum::Fletcher::flush ( void  )
virtual
cstring elm::checksum::Fletcher::lastErrorMessage ( void  )
virtual
Fletcher& elm::checksum::Fletcher::operator<< ( const char *  str)

References put().

Fletcher& elm::checksum::Fletcher::operator<< ( const CString str)

References put().

Fletcher& elm::checksum::Fletcher::operator<< ( const String str)

References put().

template<class T >
Fletcher& elm::checksum::Fletcher::operator<< ( const T &  value)

References put().

void elm::checksum::Fletcher::put ( io::InStream in)

Checksum the given stream.

Parameters
inStream to checksum.

References elm::io::InStream::read().

Referenced by operator<<(), put(), and write().

void elm::checksum::Fletcher::put ( const void *  block,
int  length 
)

Put a data block in the checksum.

Parameters
blockBlock address.
lengthBlock length.

References put().

void elm::checksum::Fletcher::put ( const CString str)

Put a C string in the checksum.

Parameters
strC string to put in.

References put().

void elm::checksum::Fletcher::put ( const String str)

Put a string in the checksum.

Parameters
strString to put in.

References put().

t::uint32 elm::checksum::Fletcher::sum ( void  )

Return the checksum.

Parameters
checksumCurrent checksum.
int elm::checksum::Fletcher::write ( const char *  buffer,
int  size 
)
virtual

References put().


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