documentation polish + todo comments in client_test.cpp

This commit is contained in:
Arvid Norberg 2013-07-20 00:38:29 +00:00
parent 6aa5eca108
commit 6e28e33b32
2 changed files with 6 additions and 2 deletions

View File

@ -470,7 +470,7 @@ def print_link(out, name):
our.write('<a href="%s">%s</a>' % (symbols[name], name)) our.write('<a href="%s">%s</a>' % (symbols[name], name))
for cat in categories: for cat in categories:
print >>out, '<h2>%s</h2>' % cat print >>out, '<h2>%s</h2><p>' % cat
category_filename = categories[cat]['filename'] category_filename = categories[cat]['filename']
for c in categories[cat]['classes']: for c in categories[cat]['classes']:
print >>out, '<a href="%s#%s">%s %s</a><br/>' % (category_filename, html_sanitize(c['name']), html_sanitize(c['type']), html_sanitize(c['name'])) print >>out, '<a href="%s#%s">%s %s</a><br/>' % (category_filename, html_sanitize(c['name']), html_sanitize(c['type']), html_sanitize(c['name']))
@ -478,6 +478,7 @@ for cat in categories:
print >>out, '<a href="%s#%s">%s()</a><br/>' % (category_filename, html_sanitize(f['name']), html_sanitize(f['name'])) print >>out, '<a href="%s#%s">%s()</a><br/>' % (category_filename, html_sanitize(f['name']), html_sanitize(f['name']))
for e in categories[cat]['enums']: for e in categories[cat]['enums']:
print >>out, '<a href="%s#%s">enum %s</a><br/>' % (category_filename, html_sanitize(e['name']), html_sanitize(e['name'])) print >>out, '<a href="%s#%s">enum %s</a><br/>' % (category_filename, html_sanitize(e['name']), html_sanitize(e['name']))
print >>out, '</p>'
out.write('</div></body></html>') out.write('</div></body></html>')
out.close() out.close()

View File

@ -58,7 +58,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/ip_filter.hpp" #include "libtorrent/ip_filter.hpp"
#include "libtorrent/magnet_uri.hpp" #include "libtorrent/magnet_uri.hpp"
#include "libtorrent/bitfield.hpp" #include "libtorrent/bitfield.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/peer_info.hpp" #include "libtorrent/peer_info.hpp"
#include "libtorrent/socket_io.hpp" // print_address #include "libtorrent/socket_io.hpp" // print_address
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
@ -785,6 +784,7 @@ void add_torrent(libtorrent::session& ses
if (share_mode) p.flags |= add_torrent_params::flag_share_mode; if (share_mode) p.flags |= add_torrent_params::flag_share_mode;
lazy_entry resume_data; lazy_entry resume_data;
// TODO: implement combine_path in here, since it's internal to libtorrent
std::string filename = combine_path(save_path, combine_path(".resume", to_hex(t->info_hash().to_string()) + ".resume")); std::string filename = combine_path(save_path, combine_path(".resume", to_hex(t->info_hash().to_string()) + ".resume"));
load_file(filename.c_str(), p.resume_data, ec); load_file(filename.c_str(), p.resume_data, ec);
@ -813,6 +813,7 @@ void scan_dir(std::string const& dir_path
using namespace libtorrent; using namespace libtorrent;
error_code ec; error_code ec;
// TODO: don't use internal directory type
for (directory i(dir_path, ec); !i.done(); i.next(ec)) for (directory i(dir_path, ec); !i.done(); i.next(ec))
{ {
std::string file = combine_path(dir_path, i.file()); std::string file = combine_path(dir_path, i.file());
@ -900,6 +901,7 @@ int save_file(std::string const& filename, std::vector<char>& v)
{ {
using namespace libtorrent; using namespace libtorrent;
// TODO: don't use internal file type here. use fopen()
file f; file f;
error_code ec; error_code ec;
if (!f.open(filename, file::write_only, ec)) return -1; if (!f.open(filename, file::write_only, ec)) return -1;
@ -1499,6 +1501,7 @@ int main(int argc, char* argv[])
} }
// create directory for resume files // create directory for resume files
// TODO: don't use internal create_directory function
create_directory(combine_path(save_path, ".resume"), ec); create_directory(combine_path(save_path, ".resume"), ec);
if (ec) if (ec)
fprintf(stderr, "failed to create resume file directory: %s\n", ec.message().c_str()); fprintf(stderr, "failed to create resume file directory: %s\n", ec.message().c_str());