libtorrent::torrent_info Class Reference

#include <torrent_info.hpp>

List of all members.

Public Types

typedef std::vector
< file_entry >::const_iterator 
file_iterator
typedef std::vector
< file_entry >
::const_reverse_iterator 
reverse_file_iterator
typedef std::vector< std::pair
< std::string, int > > 
nodes_t

Public Member Functions

 torrent_info ()
 torrent_info (sha1_hash const &info_hash)
 torrent_info (entry const &torrent_file)
 ~torrent_info ()
entry create_torrent () const
entry create_info_metadata () const
void set_comment (char const *str)
void set_creator (char const *str)
void set_piece_size (int size)
void set_hash (int index, sha1_hash const &h)
void add_tracker (std::string const &url, int tier=0)
void add_file (boost::filesystem::path file, size_type size)
void add_url_seed (std::string const &url)
std::vector< file_slicemap_block (int piece, size_type offset, int size) const
peer_request map_file (int file, size_type offset, int size) const
std::vector< std::string > const & url_seeds () const
file_iterator begin_files () const
file_iterator end_files () const
reverse_file_iterator rbegin_files () const
reverse_file_iterator rend_files () const
int num_files () const
const file_entryfile_at (int index) const
const std::vector
< announce_entry > & 
trackers () const
size_type total_size () const
size_type piece_length () const
int num_pieces () const
const sha1_hashinfo_hash () const
const std::string & name () const
void print (std::ostream &os) const
bool is_valid () const
bool priv () const
void set_priv (bool v)
void convert_file_names ()
size_type piece_size (int index) const
const sha1_hashhash_for_piece (int index) const
boost::optional
< boost::posix_time::ptime > 
creation_date () const
const std::string & creator () const
const std::string & comment () const
nodes_t const & nodes () const
void add_node (std::pair< std::string, int > const &node)
void parse_info_section (entry const &e)

Private Member Functions

void read_torrent_info (const entry &libtorrent)

Private Attributes

std::vector< announce_entrym_urls
std::vector< std::string > m_url_seeds
size_type m_piece_length
std::vector< sha1_hashm_piece_hash
std::vector< file_entrym_files
nodes_t m_nodes
size_type m_total_size
sha1_hash m_info_hash
std::string m_name
boost::posix_time::ptime m_creation_date
std::string m_comment
std::string m_created_by
bool m_multifile
bool m_private
entry m_extra_info


Detailed Description

Definition at line 95 of file torrent_info.hpp.


Member Typedef Documentation

typedef std::vector<file_entry>::const_iterator libtorrent::torrent_info::file_iterator

Definition at line 119 of file torrent_info.hpp.

typedef std::vector<file_entry>::const_reverse_iterator libtorrent::torrent_info::reverse_file_iterator

Definition at line 120 of file torrent_info.hpp.

typedef std::vector<std::pair<std::string, int> > libtorrent::torrent_info::nodes_t

Definition at line 167 of file torrent_info.hpp.


Constructor & Destructor Documentation

libtorrent::torrent_info::torrent_info (  ) 

Definition at line 226 of file torrent_info.cpp.

libtorrent::torrent_info::torrent_info ( sha1_hash const &  info_hash  ) 

Definition at line 214 of file torrent_info.cpp.

libtorrent::torrent_info::torrent_info ( entry const &  torrent_file  ) 

Definition at line 194 of file torrent_info.cpp.

References read_torrent_info().

libtorrent::torrent_info::~torrent_info (  ) 

Definition at line 238 of file torrent_info.cpp.


Member Function Documentation

entry libtorrent::torrent_info::create_torrent (  )  const

entry libtorrent::torrent_info::create_info_metadata (  )  const

void libtorrent::torrent_info::set_comment ( char const *  str  ) 

Definition at line 540 of file torrent_info.cpp.

References m_comment.

void libtorrent::torrent_info::set_creator ( char const *  str  ) 

Definition at line 545 of file torrent_info.cpp.

References m_created_by.

Referenced by main().

void libtorrent::torrent_info::set_piece_size ( int  size  ) 

Definition at line 241 of file torrent_info.cpp.

References m_piece_hash, m_piece_length, m_total_size, and num_pieces().

Referenced by main(), setup_transfer(), and test_main().

void libtorrent::torrent_info::set_hash ( int  index,
sha1_hash const &  h 
)

Definition at line 702 of file torrent_info.cpp.

References m_piece_hash.

Referenced by main(), run_storage_tests(), and setup_transfer().

void libtorrent::torrent_info::add_tracker ( std::string const &  url,
int  tier = 0 
)

void libtorrent::torrent_info::add_file ( boost::filesystem::path  file,
size_type  size 
)

void libtorrent::torrent_info::add_url_seed ( std::string const &  url  ) 

Definition at line 535 of file torrent_info.cpp.

References m_url_seeds.

Referenced by main().

std::vector< file_slice > libtorrent::torrent_info::map_block ( int  piece,
size_type  offset,
int  size 
) const

peer_request libtorrent::torrent_info::map_file ( int  file,
size_type  offset,
int  size 
) const

std::vector<std::string> const& libtorrent::torrent_info::url_seeds (  )  const [inline]

Definition at line 117 of file torrent_info.hpp.

Referenced by libtorrent::torrent::init(), and read_torrent_info().

file_iterator libtorrent::torrent_info::begin_files (  )  const [inline]

file_iterator libtorrent::torrent_info::end_files (  )  const [inline]

reverse_file_iterator libtorrent::torrent_info::rbegin_files (  )  const [inline]

Definition at line 125 of file torrent_info.hpp.

reverse_file_iterator libtorrent::torrent_info::rend_files (  )  const [inline]

Definition at line 126 of file torrent_info.hpp.

int libtorrent::torrent_info::num_files (  )  const [inline]

const file_entry& libtorrent::torrent_info::file_at ( int  index  )  const [inline]

const std::vector<announce_entry>& libtorrent::torrent_info::trackers (  )  const [inline]

size_type libtorrent::torrent_info::total_size (  )  const [inline]

size_type libtorrent::torrent_info::piece_length (  )  const [inline]

int libtorrent::torrent_info::num_pieces (  )  const [inline]

const sha1_hash& libtorrent::torrent_info::info_hash (  )  const [inline]

const std::string& libtorrent::torrent_info::name (  )  const [inline]

Definition at line 139 of file torrent_info.hpp.

Referenced by vmsBtFileImpl::get_TorrentName(), and libtorrent::torrent::name().

void libtorrent::torrent_info::print ( std::ostream &  os  )  const

bool libtorrent::torrent_info::is_valid (  )  const [inline]

bool libtorrent::torrent_info::priv (  )  const [inline]

void libtorrent::torrent_info::set_priv ( bool  v  )  [inline]

Definition at line 144 of file torrent_info.hpp.

void libtorrent::torrent_info::convert_file_names (  ) 

Definition at line 709 of file torrent_info.cpp.

size_type libtorrent::torrent_info::piece_size ( int  index  )  const

const sha1_hash& libtorrent::torrent_info::hash_for_piece ( int  index  )  const [inline]

boost::optional< ptime > libtorrent::torrent_info::creation_date (  )  const

Definition at line 469 of file torrent_info.cpp.

References m_creation_date.

const std::string& libtorrent::torrent_info::creator (  )  const [inline]

Definition at line 160 of file torrent_info.hpp.

const std::string& libtorrent::torrent_info::comment (  )  const [inline]

Definition at line 163 of file torrent_info.hpp.

Referenced by vmsBtFileImpl::get_TorrentComment().

nodes_t const& libtorrent::torrent_info::nodes (  )  const [inline]

void libtorrent::torrent_info::add_node ( std::pair< std::string, int > const &  node  ) 

Definition at line 749 of file torrent_info.cpp.

References m_nodes.

Referenced by add_node().

void libtorrent::torrent_info::parse_info_section ( entry const &  e  ) 

void libtorrent::torrent_info::read_torrent_info ( const entry libtorrent  )  [private]


Member Data Documentation

Definition at line 181 of file torrent_info.hpp.

Referenced by add_tracker(), create_torrent(), and read_torrent_info().

std::vector<std::string> libtorrent::torrent_info::m_url_seeds [private]

Definition at line 183 of file torrent_info.hpp.

Referenced by add_url_seed(), create_torrent(), and read_torrent_info().

Definition at line 196 of file torrent_info.hpp.

Referenced by add_node(), create_torrent(), and read_torrent_info().

Definition at line 199 of file torrent_info.hpp.

Referenced by add_file(), map_block(), parse_info_section(), and set_piece_size().

Definition at line 204 of file torrent_info.hpp.

Referenced by create_torrent(), and parse_info_section().

std::string libtorrent::torrent_info::m_name [private]

Definition at line 206 of file torrent_info.hpp.

Referenced by add_file(), create_info_metadata(), and parse_info_section().

boost::posix_time::ptime libtorrent::torrent_info::m_creation_date [private]

Definition at line 211 of file torrent_info.hpp.

Referenced by create_torrent(), creation_date(), print(), and read_torrent_info().

std::string libtorrent::torrent_info::m_comment [private]

Definition at line 215 of file torrent_info.hpp.

Referenced by create_torrent(), print(), read_torrent_info(), and set_comment().

Definition at line 219 of file torrent_info.hpp.

Referenced by create_torrent(), read_torrent_info(), and set_creator().

Definition at line 226 of file torrent_info.hpp.

Referenced by add_file(), create_info_metadata(), and parse_info_section().

Definition at line 230 of file torrent_info.hpp.

Referenced by create_torrent(), parse_info_section(), and print().

Definition at line 236 of file torrent_info.hpp.

Referenced by create_info_metadata(), and parse_info_section().


The documentation for this class was generated from the following files:

Generated on Sun May 25 00:21:45 2008 by  doxygen 1.5.6