ProteoWizard
Public Member Functions | Private Attributes | List of all members
pwiz::util::SHA1_ostream Class Reference

ostream filter for calculating a SHA-1 hash of data on the fly More...

#include <SHA1_ostream.hpp>

Inheritance diagram for pwiz::util::SHA1_ostream:

Public Member Functions

 SHA1_ostream (std::ostream &os, int bufferSize=4096)
 
std::string hash ()
 
void explicitFlush ()
 

Private Attributes

std::ostream & os_
 
SHA1Filter filter_
 

Detailed Description

ostream filter for calculating a SHA-1 hash of data on the fly

Definition at line 87 of file SHA1_ostream.hpp.

Constructor & Destructor Documentation

§ SHA1_ostream()

pwiz::util::SHA1_ostream::SHA1_ostream ( std::ostream &  os,
int  bufferSize = 4096 
)
inline

Definition at line 91 of file SHA1_ostream.hpp.

92  : os_(os), filter_(bufferSize)
93  {
94  push(filter_);
95  push(os);
96  }

Member Function Documentation

§ hash()

std::string pwiz::util::SHA1_ostream::hash ( )
inline

Definition at line 98 of file SHA1_ostream.hpp.

Referenced by test().

98 {return filter_.hash();}

§ explicitFlush()

void pwiz::util::SHA1_ostream::explicitFlush ( )
inline

Definition at line 100 of file SHA1_ostream.hpp.

References os_.

Referenced by test().

101  {
102  // hack: not flushing properly with the filter in the pipeline
103  pop(); // this flushes os_ explicitly
104  push(os_);
105  }

Member Data Documentation

§ os_

std::ostream& pwiz::util::SHA1_ostream::os_
private

Definition at line 108 of file SHA1_ostream.hpp.

§ filter_

SHA1Filter pwiz::util::SHA1_ostream::filter_
private

Definition at line 109 of file SHA1_ostream.hpp.


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