From 3ce15b36d17246c8b0f2e1e965d482d257c1e036 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 17 Jul 2017 20:46:02 -0700 Subject: [PATCH] fix some c++11 parsing issues in reference doc generation script --- docs/gen_reference_doc.py | 6 +++++- include/libtorrent/peer_info.hpp | 4 ++-- include/libtorrent/torrent_info.hpp | 2 +- include/libtorrent/torrent_status.hpp | 11 ++++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/gen_reference_doc.py b/docs/gen_reference_doc.py index 65917f7bd..d6e2c8aa2 100644 --- a/docs/gen_reference_doc.py +++ b/docs/gen_reference_doc.py @@ -397,7 +397,11 @@ def parse_class(lno, lines, filename): if not is_visible(context): continue l = l.split('//')[0].strip() - n = l.split(' ')[-1].split(':')[0].split(';')[0] + # the name may look like this: + # std::uint8_t fails : 7; + # int scrape_downloaded = -1; + # static constexpr peer_flags_t interesting{0x1}; + n = l.split('=')[0].split('{')[0].strip().split(' : ')[0].split(' ')[-1].split(':')[0].split(';')[0] if context == '' and blanks == 0 and len(fields): fields[-1]['names'].append(n) fields[-1]['signatures'].append(l) diff --git a/include/libtorrent/peer_info.hpp b/include/libtorrent/peer_info.hpp index c1235f70e..4679c0a23 100644 --- a/include/libtorrent/peer_info.hpp +++ b/include/libtorrent/peer_info.hpp @@ -194,7 +194,7 @@ namespace libtorrent { static constexpr peer_flags_t plaintext_encrypted{0x200000}; // tells you in which state the peer is in. It is set to - // any combination of the peer_flags_t enum. + // any combination of the peer_flags_t flags above. peer_flags_t flags; // The peer was received from the tracker. @@ -218,7 +218,7 @@ namespace libtorrent { static constexpr peer_source_flags_t incoming{0x20}; // a combination of flags describing from which sources this peer - // was received. See peer_source_flags. + // was received. A combination of the peer_source_flags_t above. peer_source_flags_t source; // the current upload and download speed we have to and from this peer diff --git a/include/libtorrent/torrent_info.hpp b/include/libtorrent/torrent_info.hpp index bc2366f1a..d263ca098 100644 --- a/include/libtorrent/torrent_info.hpp +++ b/include/libtorrent/torrent_info.hpp @@ -505,7 +505,7 @@ namespace libtorrent { // .torrent file. If the specified key cannot be found, it returns nullptr. bdecode_node info(char const* key) const; - // swap the content of this and ``ti```. + // swap the content of this and ``ti``. void swap(torrent_info& ti); // ``metadata()`` returns a the raw info section of the torrent file. The size diff --git a/include/libtorrent/torrent_status.hpp b/include/libtorrent/torrent_status.hpp index 7eec1756f..bf878cb61 100644 --- a/include/libtorrent/torrent_status.hpp +++ b/include/libtorrent/torrent_status.hpp @@ -118,17 +118,18 @@ namespace libtorrent { checking_resume_data }; - // may be set to an error code describing why the torrent was paused, in - // case it was paused by an error. If the torrent is not paused or if it's - // paused but not because of an error, this error_code is not set. - // if the error is attributed specifically to a file, error_file is set to - // the index of that file in the .torrent file. #ifndef TORRENT_NO_DEPRECATE std::string error; #else // internal std::string _dummy_string_; #endif + + // may be set to an error code describing why the torrent was paused, in + // case it was paused by an error. If the torrent is not paused or if it's + // paused but not because of an error, this error_code is not set. + // if the error is attributed specifically to a file, error_file is set to + // the index of that file in the .torrent file. error_code errc; file_index_t error_file = torrent_status::error_file_none;