Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
Arc::Adler32Sum Class Reference

Implementation of Adler32 checksum. More...

#include <CheckSum.h>

Inheritance diagram for Arc::Adler32Sum:
Inheritance graph
[legend]
Collaboration diagram for Arc::Adler32Sum:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Adler32Sum (void)
virtual void start (void)
virtual void add (void *buf, unsigned long long int len)
virtual void end (void)
virtual void result (unsigned char *&res, unsigned int &len) const
virtual int print (char *buf, int len) const
virtual void scan (const char *buf)
virtual operator bool (void) const
virtual bool operator! (void) const

Private Attributes

uLong adler
bool computed

Detailed Description

Implementation of Adler32 checksum.

Definition at line 102 of file CheckSum.h.


Constructor & Destructor Documentation

Arc::Adler32Sum::Adler32Sum ( void  ) [inline]

Definition at line 108 of file CheckSum.h.

                     : computed(false) { 
      start(); 
    }

Here is the call graph for this function:


Member Function Documentation

virtual void Arc::Adler32Sum::add ( void *  buf,
unsigned long long int  len 
) [inline, virtual]

Implements Arc::CheckSum.

Definition at line 114 of file CheckSum.h.

                                                           {
      adler = adler32(adler, (const Bytef *)buf, len); 
    }
virtual void Arc::Adler32Sum::end ( void  ) [inline, virtual]

Implements Arc::CheckSum.

Definition at line 117 of file CheckSum.h.

                           {
      computed = true;
    }
virtual Arc::Adler32Sum::operator bool ( void  ) const [inline, virtual]

Reimplemented from Arc::CheckSum.

Definition at line 134 of file CheckSum.h.

                                      {
      return computed;
    }
virtual bool Arc::Adler32Sum::operator! ( void  ) const [inline, virtual]

Reimplemented from Arc::CheckSum.

Definition at line 137 of file CheckSum.h.

                                       {
      return !computed;
    }
virtual int Arc::Adler32Sum::print ( char *  buf,
int  len 
) const [inline, virtual]

Reimplemented from Arc::CheckSum.

Definition at line 124 of file CheckSum.h.

                                               { 
      if(!computed) { 
        if(len>0) {
          buf[0]=0;
          return 0;
        }
      }
      return snprintf(buf,len,"adler32:%08lx",adler);
    };
virtual void Arc::Adler32Sum::result ( unsigned char *&  res,
unsigned int &  len 
) const [inline, virtual]

Implements Arc::CheckSum.

Definition at line 120 of file CheckSum.h.

                                                                     { 
      res=(unsigned char*)&adler;
      len=4;
    }  
virtual void Arc::Adler32Sum::scan ( const char *  buf) [inline, virtual]

Implements Arc::CheckSum.

Definition at line 133 of file CheckSum.h.

{ };
virtual void Arc::Adler32Sum::start ( void  ) [inline, virtual]

Implements Arc::CheckSum.

Definition at line 111 of file CheckSum.h.

                             {
      adler = adler32(0L, Z_NULL, 0); 
    }

Here is the caller graph for this function:


Member Data Documentation

uLong Arc::Adler32Sum::adler [private]

Definition at line 105 of file CheckSum.h.

bool Arc::Adler32Sum::computed [private]

Definition at line 106 of file CheckSum.h.


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