* Added "close_on_ratio".

* Allow commands to be appended to "{stop,close}_on_ratio".


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@976 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-09-06 22:39:43 +00:00
parent 3b82216a1b
commit 804eb769a0
6 changed files with 67 additions and 24 deletions
+5
View File
@@ -259,6 +259,11 @@ object_fn(Return (*func)(Target)) { return new object_void_fn_t<Target, Return (
template <typename Return> object_void_fn_t<void, Return (*)(), Return>*
object_fn(Return (*func)()) { return new object_void_fn_t<void, Return (*)(), Return>(func); }
template <typename Target, typename Return> object_void_fn_t<Target, Return (*)(Target), Return>*
object_void_fn(Return (*func)(Target)) { return new object_void_fn_t<Target, Return (*)(Target), Return>(func); }
template <typename Return> object_void_fn_t<void, Return (*)(), Return>*
object_void_fn(Return (*func)()) { return new object_void_fn_t<void, Return (*)(), Return>(func); }
template <typename Func> object_void_fn_t<void, Func>* object_void_fn(Func func) { return new object_void_fn_t<void, Func>(func); }
template <typename Target, typename Func> object_void_fn_t<Target, Func>* object_void_fn(Func func) { return new object_void_fn_t<Target, Func>(func); }
template <typename Func> object_value_fn_t<void, Func>* object_value_fn(Func func) { return new object_value_fn_t<void, Func>(func); }
+5
View File
@@ -149,6 +149,11 @@ parse_command_multiple(target_type target, const char* first, const char* last)
}
}
parse_command_type
parse_command_object(target_type target, const torrent::Object& object) {
return parse_command(target, object.as_string().c_str(), object.as_string().c_str() + object.as_string().size());
}
bool
parse_command_file(const std::string& path) {
std::fstream file(rak::path_expand(path).c_str(), std::ios::in);
+3
View File
@@ -62,6 +62,9 @@ typedef std::pair<torrent::Object, const char*> parse_command_type;
parse_command_type parse_command(target_type target, const char* first, const char* last);
void parse_command_multiple(target_type target, const char* first, const char* last);
// Make this take care of lists too.
parse_command_type parse_command_object(target_type target, const torrent::Object& object);
inline void parse_command_single(target_type target, const char* first) { parse_command(target, first, first + std::strlen(first)); }
inline void parse_command_multiple(target_type target, const char* first) { parse_command_multiple(target, first, first + std::strlen(first)); }