From 6e28e33b32545957a4f210c229863bf57c24c1ba Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 20 Jul 2013 00:38:29 +0000 Subject: [PATCH] documentation polish + todo comments in client_test.cpp --- docs/gen_reference_doc.py | 3 ++- examples/client_test.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/gen_reference_doc.py b/docs/gen_reference_doc.py index b8a4c65a4..b26566a4b 100644 --- a/docs/gen_reference_doc.py +++ b/docs/gen_reference_doc.py @@ -470,7 +470,7 @@ def print_link(out, name): our.write('%s' % (symbols[name], name)) for cat in categories: - print >>out, '

%s

' % cat + print >>out, '

%s

' % cat category_filename = categories[cat]['filename'] for c in categories[cat]['classes']: print >>out, '%s %s
' % (category_filename, html_sanitize(c['name']), html_sanitize(c['type']), html_sanitize(c['name'])) @@ -478,6 +478,7 @@ for cat in categories: print >>out, '%s()
' % (category_filename, html_sanitize(f['name']), html_sanitize(f['name'])) for e in categories[cat]['enums']: print >>out, 'enum %s
' % (category_filename, html_sanitize(e['name']), html_sanitize(e['name'])) + print >>out, '

' out.write('') out.close() diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 1b1ec30d6..75b81f1c2 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -58,7 +58,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/ip_filter.hpp" #include "libtorrent/magnet_uri.hpp" #include "libtorrent/bitfield.hpp" -#include "libtorrent/file.hpp" #include "libtorrent/peer_info.hpp" #include "libtorrent/socket_io.hpp" // print_address #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; 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")); load_file(filename.c_str(), p.resume_data, ec); @@ -813,6 +813,7 @@ void scan_dir(std::string const& dir_path using namespace libtorrent; error_code ec; + // TODO: don't use internal directory type for (directory i(dir_path, ec); !i.done(); i.next(ec)) { std::string file = combine_path(dir_path, i.file()); @@ -900,6 +901,7 @@ int save_file(std::string const& filename, std::vector& v) { using namespace libtorrent; + // TODO: don't use internal file type here. use fopen() file f; error_code ec; 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 + // TODO: don't use internal create_directory function create_directory(combine_path(save_path, ".resume"), ec); if (ec) fprintf(stderr, "failed to create resume file directory: %s\n", ec.message().c_str());