moved load_file into torrent_info.cpp to make it available on windows too. Fixed the exception free path in torrent_info

This commit is contained in:
Arvid Norberg
2008-07-01 11:00:00 +00:00
parent a71170e601
commit 40d7e2ce75
5 changed files with 26 additions and 25 deletions

View File

@@ -133,20 +133,6 @@ namespace libtorrent
{
namespace fs = boost::filesystem;
int load_file(fs::path const& filename, std::vector<char>& v)
{
file f;
if (!f.open(filename, file::in)) return -1;
f.seek(0, file::end);
size_type s = f.tell();
if (s > 5000000) return -2;
v.resize(s);
f.seek(0);
size_type read = f.read(&v[0], s);
if (read != s) return -3;
return 0;
}
const file::open_mode file::in(mode_in);
const file::open_mode file::out(mode_out);