2011-01-24 23:48:03 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-25 20:07:27 +03:00
|
|
|
#ifndef _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_
|
|
|
|
#define _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <Directory.h>
|
|
|
|
#include <Entry.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#include <package/ChecksumAccessors.h>
|
|
|
|
#include <package/Job.h>
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPackageKit {
|
2011-01-24 23:48:03 +03:00
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPrivate {
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
class ValidateChecksumJob : public BJob {
|
2011-01-25 22:36:09 +03:00
|
|
|
typedef BJob inherited;
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
ValidateChecksumJob(
|
2011-01-25 20:07:27 +03:00
|
|
|
const BContext& context,
|
2011-01-24 23:48:03 +03:00
|
|
|
const BString& title,
|
|
|
|
ChecksumAccessor* expectedChecksumAccessor,
|
|
|
|
ChecksumAccessor* realChecksumAccessor,
|
|
|
|
bool failIfChecksumsDontMatch = true);
|
|
|
|
virtual ~ValidateChecksumJob();
|
|
|
|
|
|
|
|
bool ChecksumsMatch() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual status_t Execute();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ChecksumAccessor* fExpectedChecksumAccessor;
|
|
|
|
ChecksumAccessor* fRealChecksumAccessor;
|
|
|
|
bool fFailIfChecksumsDontMatch;
|
|
|
|
|
|
|
|
bool fChecksumsMatch;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPrivate
|
2011-01-24 23:48:03 +03:00
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPackageKit
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
#endif // _PACKAGE__PRIVATE__VALIDATE_CHECKSUM_JOB_H_
|