diff options
Diffstat (limited to 'libqpdf/qpdf/Pl_MD5.hh')
-rw-r--r-- | libqpdf/qpdf/Pl_MD5.hh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libqpdf/qpdf/Pl_MD5.hh b/libqpdf/qpdf/Pl_MD5.hh new file mode 100644 index 00000000..2d9d11fd --- /dev/null +++ b/libqpdf/qpdf/Pl_MD5.hh @@ -0,0 +1,30 @@ + +#ifndef __PL_MD5_HH__ +#define __PL_MD5_HH__ + +// This pipeline sends its output to its successor unmodified. After +// calling finish, the MD5 checksum of the data that passed through +// the pipeline is available. + +// This pipeline is reusable; i.e., it is safe to call write() after +// calling finish(). The first call to write() after a call to +// finish() initializes a new MD5 object. + +#include <qpdf/Pipeline.hh> +#include <qpdf/MD5.hh> + +class Pl_MD5: public Pipeline +{ + public: + Pl_MD5(char const* identifier, Pipeline* next); + virtual ~Pl_MD5(); + virtual void write(unsigned char*, int); + virtual void finish(); + std::string getHexDigest(); + + private: + bool in_progress; + MD5 md5; +}; + +#endif // __PL_MD5_HH__ |