Make UEFI boot-platform build again
[haiku.git] / headers / private / package / HashableString.h
blob04969a79a4dd0e5cd574cab2fad671079664c9ea
1 /*
2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _PACKAGE__PRIVATE__HASHABLE_STRING_H_
6 #define _PACKAGE__PRIVATE__HASHABLE_STRING_H_
9 #include <String.h>
11 #include <HashString.h>
14 namespace BPackageKit {
16 namespace BPrivate {
19 class HashableString : public BString {
20 public:
21 inline HashableString();
23 inline HashableString(const BString& string);
25 inline uint32 GetHashCode() const;
27 inline bool operator!= (const HashableString& other) const;
29 private:
30 uint32 fHashCode;
34 inline
35 HashableString::HashableString()
37 fHashCode(0)
42 inline
43 HashableString::HashableString(const BString& string)
45 BString(string),
46 fHashCode(string_hash(String()))
51 inline uint32
52 HashableString::GetHashCode() const
54 return fHashCode;
58 inline bool
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_