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__CHECKSUM_ACCESSORS_H_
|
|
|
|
#define _PACKAGE__PRIVATE__CHECKSUM_ACCESSORS_H_
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <Entry.h>
|
|
|
|
#include <String.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
|
|
|
|
|
|
|
|
|
|
|
class ChecksumAccessor {
|
|
|
|
public:
|
|
|
|
virtual ~ChecksumAccessor();
|
|
|
|
|
|
|
|
virtual status_t GetChecksum(BString& checksum) const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ChecksumFileChecksumAccessor : public ChecksumAccessor {
|
|
|
|
public:
|
|
|
|
ChecksumFileChecksumAccessor(
|
|
|
|
const BEntry& checksumFileEntry);
|
|
|
|
|
|
|
|
virtual status_t GetChecksum(BString& checksum) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
BEntry fChecksumFileEntry;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class GeneralFileChecksumAccessor : public ChecksumAccessor {
|
|
|
|
public:
|
|
|
|
GeneralFileChecksumAccessor(
|
|
|
|
const BEntry& fileEntry,
|
|
|
|
bool skipMissingFile = false);
|
|
|
|
|
|
|
|
virtual status_t GetChecksum(BString& checksum) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
BEntry fFileEntry;
|
|
|
|
bool fSkipMissingFile;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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__CHECKSUM_ACCESSORS_H_
|