D:/opendownloadmanager/ODM-1.x/Bittorrent/libtorrent-0.12/examples/client_test.cpp File Reference

#include <iostream>
#include <fstream>
#include <iterator>
#include <exception>
#include "libtorrent/config.hpp"
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/bind.hpp>
#include <boost/program_options.hpp>
#include <boost/regex.hpp>
#include "libtorrent/extensions/metadata_transfer.hpp"
#include "libtorrent/extensions/ut_pex.hpp"
#include "libtorrent/entry.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/identify_client.hpp"
#include "libtorrent/alert_types.hpp"
#include "libtorrent/ip_filter.hpp"
#include <stdlib.h>
#include <stdio.h>
#include <termios.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  set_keypress

Defines

#define ANSI_TERMINAL_COLORS

Typedefs

typedef std::multimap
< std::string,
libtorrent::torrent_handle
handles_t

Functions

bool sleep_and_input (char *c)
void clear_home ()
std::string esc (char const *code)
std::string to_string (float v, int width, int precision=3)
std::string pos_to_string (float v, int width, int precision=4)
std::string ratio (float a, float b)
std::string add_suffix (float val)
std::string progress_bar (float progress, int width, char const *code="33")
int peer_index (libtorrent::tcp::endpoint addr, std::vector< libtorrent::peer_info > const &peers)
void print_peer_info (std::ostream &out, std::vector< libtorrent::peer_info > const &peers)
void add_torrent (libtorrent::session &ses, handles_t &handles, std::string const &torrent, float preferred_ratio, bool compact_mode, path const &save_path, bool monitored_dir)
void scan_dir (path const &dir_path, libtorrent::session &ses, handles_t &handles, float preferred_ratio, bool compact_mode, path const &save_path)
int main (int ac, char *av[])


Define Documentation

#define ANSI_TERMINAL_COLORS

Definition at line 82 of file client_test.cpp.


Typedef Documentation

typedef std::multimap<std::string, libtorrent::torrent_handle> handles_t

Definition at line 283 of file client_test.cpp.


Function Documentation

std::string add_suffix ( float  val  ) 

Definition at line 183 of file client_test.cpp.

References to_string().

Referenced by main(), and print_peer_info().

void add_torrent ( libtorrent::session ses,
handles_t handles,
std::string const &  torrent,
float  preferred_ratio,
bool  compact_mode,
path const &  save_path,
bool  monitored_dir 
)

void clear_home (  ) 

Definition at line 119 of file client_test.cpp.

Referenced by main().

std::string esc ( char const *  code  ) 

Definition at line 126 of file client_test.cpp.

Referenced by main(), print_peer_info(), and progress_bar().

int main ( int  ac,
char *  av[] 
)

int peer_index ( libtorrent::tcp::endpoint  addr,
std::vector< libtorrent::peer_info > const &  peers 
)

Definition at line 209 of file client_test.cpp.

References asio::detail::socket_ops::bind(), and ip.

Referenced by main().

std::string pos_to_string ( float  v,
int  width,
int  precision = 4 
)

Definition at line 151 of file client_test.cpp.

References simple_client::s.

Referenced by ratio().

void print_peer_info ( std::ostream &  out,
std::vector< libtorrent::peer_info > const &  peers 
)

Definition at line 220 of file client_test.cpp.

References add_suffix(), esc(), progress_bar(), and to_string().

Referenced by main().

std::string progress_bar ( float  progress,
int  width,
char const *  code = "33" 
)

Definition at line 196 of file client_test.cpp.

References esc().

Referenced by main(), and print_peer_info().

std::string ratio ( float  a,
float  b 
)

Definition at line 162 of file client_test.cpp.

References pos_to_string(), and simple_client::s.

Referenced by main(), and libtorrent::peer_connection::share_diff().

void scan_dir ( path const &  dir_path,
libtorrent::session ses,
handles_t handles,
float  preferred_ratio,
bool  compact_mode,
path const &  save_path 
)

bool sleep_and_input ( char *  c  ) 

Definition at line 101 of file client_test.cpp.

References simple_client::s, and asio::detail::socket_ops::select().

Referenced by main().

std::string to_string ( float  v,
int  width,
int  precision = 3 
)


Generated on Sun May 25 00:19:40 2008 by  doxygen 1.5.6