mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-06 06:09:22 +00:00
* 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:
@@ -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); }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user