* Got rid of some additional internal sigc++ calls.

* Changed print_hhmmss/ddmmyyyy to use a char buffer.

* Added error messages for failed torrent http/file downloads which
includes the url/filename.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@581 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-10-17 19:19:48 +00:00
parent c99cc03d19
commit 45781e8dbf
7 changed files with 68 additions and 30 deletions
+23
View File
@@ -393,6 +393,23 @@ private:
Function m_function;
};
template <typename Object, typename Ret, typename Arg1>
class const_mem_fn1 {
public:
typedef Ret (Object::*Function)(Arg1) const;
const_mem_fn1() : m_object(NULL) {}
const_mem_fn1(Object* o, Function f) : m_object(o), m_function(f) {}
bool is_valid() const { return m_object; }
Ret operator () (Arg1 a1) { return (m_object->*m_function)(a1); }
private:
Object* m_object;
Function m_function;
};
template <typename Object, typename Ret, typename Arg1, typename Arg2>
class mem_fn2 {
public:
@@ -445,6 +462,12 @@ make_mem_fn(Object* o, Ret (Object::*f)(Arg1)) {
return mem_fn1<Object, Ret, Arg1>(o, f);
}
template <typename Object, typename Ret, typename Arg1>
inline const_mem_fn1<Object, Ret, Arg1>
make_mem_fn(Object* o, Ret (Object::*f)(Arg1) const) {
return const_mem_fn1<Object, Ret, Arg1>(o, f);
}
template <typename Object, typename Ret, typename Arg1, typename Arg2>
inline mem_fn2<Object, Ret, Arg1, Arg2>
make_mem_fn(Object* o, Ret (Object::*f)(Arg1, Arg2)) {