2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3 * Distributed under the terms of the MIT License.
5 #ifndef _PACKAGE__PRIVATE__CHECKSUM_ACCESSORS_H_
6 #define _PACKAGE__PRIVATE__CHECKSUM_ACCESSORS_H_
13 namespace BPackageKit
{
18 class ChecksumAccessor
{
20 virtual ~ChecksumAccessor();
22 virtual status_t
GetChecksum(BString
& checksum
) const = 0;
26 class ChecksumFileChecksumAccessor
: public ChecksumAccessor
{
28 ChecksumFileChecksumAccessor(
29 const BEntry
& checksumFileEntry
);
31 virtual status_t
GetChecksum(BString
& checksum
) const;
34 BEntry fChecksumFileEntry
;
38 class GeneralFileChecksumAccessor
: public ChecksumAccessor
{
40 GeneralFileChecksumAccessor(
41 const BEntry
& fileEntry
,
42 bool skipMissingFile
= false);
44 virtual status_t
GetChecksum(BString
& checksum
) const;
48 bool fSkipMissingFile
;
52 class StringChecksumAccessor
: public ChecksumAccessor
{
54 StringChecksumAccessor(const BString
& checksum
);
56 virtual status_t
GetChecksum(BString
& _checksum
) const;
63 } // namespace BPrivate
65 } // namespace BPackageKit
68 #endif // _PACKAGE__PRIVATE__CHECKSUM_ACCESSORS_H_