1 /* 2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de> 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_ 6 #define _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_ 7 8 9 #include <Directory.h> 10 #include <Entry.h> 11 #include <String.h> 12 13 #include <package/ChecksumAccessors.h> 14 #include <package/Job.h> 15 16 17 namespace BPackageKit { 18 19 namespace BPrivate { 20 21 22 class ValidateChecksumJob : public BJob { 23 typedef BJob inherited; 24 25 public: 26 ValidateChecksumJob( 27 const BContext& context, 28 const BString& title, 29 ChecksumAccessor* expectedChecksumAccessor, 30 ChecksumAccessor* realChecksumAccessor, 31 bool failIfChecksumsDontMatch = true); 32 virtual ~ValidateChecksumJob(); 33 34 bool ChecksumsMatch() const; 35 36 protected: 37 virtual status_t Execute(); 38 39 private: 40 ChecksumAccessor* fExpectedChecksumAccessor; 41 ChecksumAccessor* fRealChecksumAccessor; 42 bool fFailIfChecksumsDontMatch; 43 44 bool fChecksumsMatch; 45 }; 46 47 48 } // namespace BPrivate 49 50 } // namespace BPackageKit 51 52 53 #endif // _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_ 54