VHISTlib
1.84.0.3018
|
00001 /* $HEADERS 00002 $Id: validator.h 2792 2013-05-06 11:25:27Z michael $ 00003 */ 00004 00005 #ifndef VALIDATOR_INCLUDED 00006 #define VALIDATOR_INCLUDED 00007 00008 #include "../shared/misc_defines.h" 00009 00010 #include <QObject> 00011 #include <QString> 00012 00013 #include "md5generator.h" 00014 #include "inflater.h" 00015 00016 class QByteArray; 00017 00018 namespace vhist 00019 { 00020 00034 class VHIST_EXTERN Validator : public QObject 00035 { 00036 Q_OBJECT 00037 public: // construction, destruction, assignment 00038 Validator(const QString& md5 = "", const QString& compressedMD5 = ""); 00039 virtual ~Validator(); 00040 void reinit(const QString& md5, const QString& compressedMD5 = ""); 00041 00042 public: 00043 void update(const QByteArray& data); 00044 bool isValid(); 00045 00046 private: // member variables 00047 QString m_expectedMD5; 00048 QString m_expectedCompressedMD5; 00049 bool m_decompress; 00050 MD5Generator m_md5; 00051 MD5Generator m_compressedMD5; 00052 Inflater m_inflater; 00053 }; 00054 00055 } 00056 00057 #endif // VALIDATOR_INCLUDED 00058