Changeset 800 for trunk/libtorrent/src/torrent/hash_string.h
- Timestamp:
- 11/04/06 11:05:28 (6 years ago)
- Files:
-
- 1 modified
-
trunk/libtorrent/src/torrent/hash_string.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtorrent/src/torrent/hash_string.h
r799 r800 86 86 void assign(const value_type* src) { std::memcpy(data(), src, size()); } 87 87 88 bool compare(const char* hash) { return std::memcmp(m_data, hash, size()); } 88 bool equal_to(const char* hash) const { return std::memcmp(m_data, hash, size()) == 0; } 89 bool not_equal_to(const char* hash) const { return std::memcmp(m_data, hash, size()) == 1; } 89 90 90 91 private: … … 107 108 } 108 109 109 inline bool110 operator == (const HashString& one, const char* two) {111 return std::memcmp(one.begin(), two, HashString::size_data) == 0;112 }113 114 inline bool115 operator != (const HashString& one, const char* two) {116 return std::memcmp(one.begin(), two, HashString::size_data) != 0;117 }118 119 inline bool120 operator == (const char* one, const HashString& two) {121 return std::memcmp(one, two.begin(), HashString::size_data) == 0;122 }123 124 inline bool125 operator != (const char* one, const HashString& two) {126 return std::memcmp(one, two.begin(), HashString::size_data) != 0;127 }128 129 110 } 130 111
