add file_name() to file_storage

This commit is contained in:
Arvid Norberg
2012-08-31 02:31:37 +00:00
parent 64a56e4581
commit 52f679d5dc
2 changed files with 14 additions and 0 deletions

View File

@@ -426,6 +426,13 @@ namespace libtorrent
return combine_path(m_paths[fe.path_index], fe.filename());
}
std::string file_storage::file_name(int index) const
{
TORRENT_ASSERT(index >= 0 && index < int(m_files.size()));
internal_file_entry const& fe = m_files[index];
return fe.filename();
}
size_type file_storage::file_size(int index) const
{
TORRENT_ASSERT(index >= 0 && index < int(m_files.size()));
@@ -481,6 +488,11 @@ namespace libtorrent
return combine_path(m_paths[fe.path_index], fe.filename());
}
std::string file_storage::file_name(internal_file_entry const& fe) const
{
return fe.filename();
}
size_type file_storage::file_size(internal_file_entry const& fe) const
{
return fe.size;