* Added 'method.rlookup' and 'method.rlookup.clear' commands for looking up the event handlers holding a specified key.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1231 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2011-05-26 03:38:45 +00:00
parent 5200454cf7
commit d2f328cc8e
7 changed files with 125 additions and 21 deletions
+8
View File
@@ -80,6 +80,9 @@ public:
bool operator == (const fixed_key_type& rhs) const { return m_size == rhs.m_size && std::memcmp(m_data, rhs.m_data, m_size) == 0; }
bool operator != (const fixed_key_type& rhs) const { return m_size != rhs.m_size || std::memcmp(m_data, rhs.m_data, m_size) != 0; }
bool operator == (const torrent::raw_string& rhs) const { return m_size == rhs.size() && std::memcmp(m_data, rhs.data(), m_size) == 0; }
bool operator != (const torrent::raw_string& rhs) const { return m_size != rhs.size() || std::memcmp(m_data, rhs.data(), m_size) != 0; }
bool operator == (const std::string& rhs) const { return m_size == rhs.size() && std::memcmp(m_data, rhs.data(), m_size) == 0; }
private:
@@ -110,6 +113,11 @@ struct hash_fixed_key_type {
}
};
template <size_t MaxSize>
bool operator == (const torrent::raw_string& lhs, const fixed_key_type<MaxSize>& rhs) {
return lhs.size() == rhs.size() && std::memcmp(lhs.data(), rhs.data(), lhs.size()) == 0;
}
}
#endif