fix parsing of enum classes in doc generation tool

This commit is contained in:
arvidn 2019-12-19 02:18:56 +01:00 committed by Arvid Norberg
parent 6110144a3b
commit 078f7b956e
4 changed files with 43 additions and 8 deletions

View File

@ -567,7 +567,7 @@ def parse_enum(lno, lines, filename):
global anon_index
line = lines[lno].strip()
name = line.replace('enum ', '').split('{')[0].strip()
name = line.replace('enum ', '').replace('class ', '').split(':')[0].split('{')[0].strip()
if len(name) == 0:
if not internal:
print('WARNING: anonymous enum at: \x1b[34m%s:%d\x1b[0m' % (filename, lno))
@ -888,7 +888,7 @@ for filename in files:
blanks = 0
continue
if ('class ' in line or 'struct ' in line) and ';' not in line:
if ('enum class ' not in line and 'class ' in line or 'struct ' in line) and ';' not in line:
lno = consume_block(lno - 1, lines)
context = ''
blanks += 1

View File

@ -547,3 +547,7 @@ tos
BP
qB
LT1230
iocontrol
getname
getpeername
fastresume

View File

@ -534,7 +534,7 @@ namespace libtorrent {
// internal
std::int32_t file_idx:24;
// A code from file_operation_t enum, indicating what
// A code from operation_t enum, indicating what
// kind of operation failed.
operation_t operation;

View File

@ -52,7 +52,7 @@ namespace libtorrent {
// a call to iocontrol failed
iocontrol,
// a call to getpeername failed (querying the remote IP of a
// a call to ``getpeername()`` failed (querying the remote IP of a
// connection)
getpeername,
@ -107,7 +107,7 @@ namespace libtorrent {
sock_listen,
// a call to the ioctl to bind a socket to a specific network device or
// adaptor
// adapter
sock_bind_to_device,
// a call to accept() on a socket
@ -119,21 +119,52 @@ namespace libtorrent {
// enumeration network devices or adapters
enum_if,
// invoking stat() on a file
file_stat,
// copying a file
file_copy,
// allocating storage for a file
file_fallocate,
// creating a hard link
file_hard_link,
// removing a file
file_remove,
// renaming a file
file_rename,
// opening a file
file_open,
// creating a directory
mkdir,
// check fast resume data against files on disk
check_resume,
// an unknown exception
exception,
// allocate space for a piece in the cache
alloc_cache_piece,
// move a part-file
partfile_move,
// read from a part file
partfile_read,
// write to a part-file
partfile_write,
// a hostname lookup
hostname_lookup,
// create or read a symlink
symlink,
};
@ -151,14 +182,14 @@ namespace libtorrent {
// determines to disconnect
op_bittorrent TORRENT_DEPRECATED_ENUM ,
// a call to iocontrol failed
// a call to ``iocontrol()`` failed
op_iocontrol TORRENT_DEPRECATED_ENUM,
// a call to getpeername failed (querying the remote IP of a
// a call to ``getpeername()`` failed (querying the remote IP of a
// connection)
op_getpeername TORRENT_DEPRECATED_ENUM,
// a call to getname failed (querying the local IP of a
// a call to ``getsockname()`` failed (querying the local IP of a
// connection)
op_getname TORRENT_DEPRECATED_ENUM,