merged file_win.cpp and file.cpp (removed the need for file_win.cpp). The file is no longer a pimpl

This commit is contained in:
Arvid Norberg
2008-07-20 11:14:54 +00:00
parent 0433a32857
commit 417855848f
6 changed files with 239 additions and 602 deletions

View File

@@ -56,6 +56,7 @@ namespace libtorrent
#if BOOST_VERSION < 103500
typedef asio::error_code error_code;
inline asio::error::error_category get_posix_category() { return asio::error::system_category; }
inline asio::error::error_category get_system_category() { return asio::error::system_category; }
#else
struct libtorrent_error_category : boost::system::error_category
@@ -69,6 +70,8 @@ namespace libtorrent
extern libtorrent_error_category libtorrent_category;
using boost::system::error_code;
inline boost::system::error_category const& get_system_category()
{ return boost::system::get_system_category(); }
inline boost::system::error_category const& get_posix_category()
{ return boost::system::get_posix_category(); }
#endif

View File

@@ -77,7 +77,6 @@ namespace libtorrent
public:
open_mode(): m_mask(0) {}
open_mode operator|(open_mode m) const
{ return open_mode(m.m_mask | m_mask); }
@@ -92,6 +91,7 @@ namespace libtorrent
bool operator==(open_mode m) const { return m_mask == m.m_mask; }
bool operator!=(open_mode m) const { return m_mask != m.m_mask; }
operator bool() const { return m_mask != 0; }
private:
@@ -107,6 +107,7 @@ namespace libtorrent
~file();
bool open(fs::path const& p, open_mode m, error_code& ec);
bool is_open() const;
void close();
bool set_size(size_type size, error_code& ec);
@@ -118,8 +119,14 @@ namespace libtorrent
private:
struct impl;
const std::auto_ptr<impl> m_impl;
#ifdef TORRENT_WINDOWS
HANDLE m_file_handle;
#else
int m_fd;
#endif
#ifndef NDEBUG
open_mode m_open_mode;
#endif
};