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 global anon_index
line = lines[lno].strip() 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 len(name) == 0:
if not internal: if not internal:
print('WARNING: anonymous enum at: \x1b[34m%s:%d\x1b[0m' % (filename, lno)) print('WARNING: anonymous enum at: \x1b[34m%s:%d\x1b[0m' % (filename, lno))
@ -888,7 +888,7 @@ for filename in files:
blanks = 0 blanks = 0
continue 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) lno = consume_block(lno - 1, lines)
context = '' context = ''
blanks += 1 blanks += 1

View File

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

View File

@ -534,7 +534,7 @@ namespace libtorrent {
// internal // internal
std::int32_t file_idx:24; 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. // kind of operation failed.
operation_t operation; operation_t operation;

View File

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