*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-10-13 15:36:44 +00:00
parent 5d455c9046
commit f324cc925e
3 changed files with 20 additions and 0 deletions

View File

@ -144,6 +144,8 @@ namespace libtorrent
void operator=(const list_type&);
void operator=(const integer_type&);
void sort();
integer_type& integer();
const integer_type& integer() const;
string_type& string();

View File

@ -244,6 +244,18 @@ namespace libtorrent
}
}
void entry::sort()
{
using boost::bind;
if (type() == dictionary_t)
{
std::stable_sort(dict().begin(), dict().end()
, bind(std::less<std::string>()
, bind(&entry::dictionary_type::value_type::first, _1)
, bind(&entry::dictionary_type::value_type::first, _2)));
}
}
void entry::print(std::ostream& os, int indent) const
{
assert(indent >= 0);

View File

@ -399,6 +399,7 @@ namespace libtorrent
{
path_e.list().push_back(*j);
}
file_e.sort();
}
}
@ -414,6 +415,9 @@ namespace libtorrent
{
p.append((char*)i->begin(), (char*)i->end());
}
info.sort();
return info;
}
@ -448,6 +452,8 @@ namespace libtorrent
dict["info"] = create_info_metadata();
dict.sort();
return dict;
}