* Removed the Object ctor taking an Object::type_type.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1026 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-01-06 15:41:30 +00:00
parent 77a7d13b39
commit 87e02737ce
13 changed files with 35 additions and 31 deletions
+4 -4
View File
@@ -69,7 +69,7 @@ CommandSlot<Target>::call_list(Command* rawCommand, Target target, const torrent
case torrent::Object::TYPE_STRING:
case torrent::Object::TYPE_NONE:
{
torrent::Object tmpList(torrent::Object::TYPE_LIST);
torrent::Object tmpList = torrent::Object::create_list();
tmpList.as_list().push_back(rawArgs);
return command->m_slot(target, tmpList);
@@ -91,7 +91,7 @@ CommandSlot<void>::call_list(Command* rawCommand, const torrent::Object& rawArgs
case torrent::Object::TYPE_STRING:
case torrent::Object::TYPE_NONE:
{
torrent::Object tmpList(torrent::Object::TYPE_LIST);
torrent::Object tmpList = torrent::Object::create_list();
tmpList.as_list().push_back(rawArgs);
return command->m_slot(tmpList);
@@ -114,7 +114,7 @@ CommandSlot<Target>::call_value_base(Command* rawCommand, Target target, const t
case torrent::Object::TYPE_STRING:
{
torrent::Object argValue(torrent::Object::TYPE_VALUE);
torrent::Object argValue = torrent::Object::create_value();
if (!parse_whole_value_nothrow(arg.as_string().c_str(), &argValue.as_value(), base, unit))
throw torrent::input_error("Not a value.");
@@ -139,7 +139,7 @@ CommandSlot<void>::call_value_base(Command* rawCommand, const torrent::Object& r
case torrent::Object::TYPE_STRING:
{
torrent::Object argValue(torrent::Object::TYPE_VALUE);
torrent::Object argValue = torrent::Object::create_value();
if (!parse_whole_value_nothrow(arg.as_string().c_str(), &argValue.as_value(), base, unit))
throw torrent::input_error("Not a value.");
+2 -2
View File
@@ -170,7 +170,7 @@ parse_value_nothrow(const char* src, int64_t* value, int base, int unit) {
const char*
parse_object(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char)) {
if (*first == '{') {
*dest = torrent::Object(torrent::Object::TYPE_LIST);
*dest = torrent::Object::create_list();
first = parse_list(first + 1, last, dest, &parse_is_delim_list);
first = parse_skip_wspace(first, last);
@@ -216,7 +216,7 @@ parse_whole_list(const char* first, const char* last, torrent::Object* dest) {
first = parse_skip_wspace(first, last);
if (first != last && parse_is_seperator(*first)) {
torrent::Object tmp = torrent::Object(torrent::Object::TYPE_LIST);
torrent::Object tmp = torrent::Object::create_list();
tmp.swap(*dest);
dest->as_list().push_back(tmp);
+1 -1
View File
@@ -109,7 +109,7 @@ inline void call_command_d_set_std_string(const std::string& key, cor
inline torrent::Object
call_command_d_range(const char* key, core::Download* download, torrent::Object::list_const_iterator first, torrent::Object::list_const_iterator last) {
// Change to using range ctor.
torrent::Object rawArgs(torrent::Object::TYPE_LIST);
torrent::Object rawArgs = torrent::Object::create_list();
torrent::Object::list_type& args = rawArgs.as_list();
while (first != last)
+2 -2
View File
@@ -106,7 +106,7 @@ xmlrpc_to_object(xmlrpc_env* env, xmlrpc_value* value) {
case XMLRPC_TYPE_ARRAY:
{
torrent::Object result(torrent::Object::TYPE_LIST);
torrent::Object result = torrent::Object::create_list();
torrent::Object::list_type& listRef = result.as_list();
unsigned int last = xmlrpc_array_size(env, value);
@@ -292,7 +292,7 @@ xmlrpc_to_object_target(xmlrpc_env* env, xmlrpc_value* value, int callType, void
torrent::Object result;
if (current + 1 < last) {
result = torrent::Object(torrent::Object::TYPE_LIST);
result = torrent::Object::create_list();
torrent::Object::list_type& listRef = result.as_list();
// Move this into a helper function?