2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3 * Distributed under the terms of the MIT License.
5 #ifndef _PACKAGE__PRIVATE__HASHABLE_STRING_H_
6 #define _PACKAGE__PRIVATE__HASHABLE_STRING_H_
11 #include <HashString.h>
14 namespace BPackageKit
{
19 class HashableString
: public BString
{
21 inline HashableString();
23 inline HashableString(const BString
& string
);
25 inline uint32
GetHashCode() const;
27 inline bool operator!= (const HashableString
& other
) const;
35 HashableString::HashableString()
43 HashableString::HashableString(const BString
& string
)
46 fHashCode(string_hash(String()))
52 HashableString::GetHashCode() const
59 HashableString::operator!= (const HashableString
& other
) const
61 return Compare(other
) != 0 || fHashCode
!= other
.fHashCode
;
65 } // namespace BPrivate
67 } // namespace BPackageKit
70 #endif // _PACKAGE__PRIVATE__HASHABLE_STRING_H_