deepin-ocr/3rdparty/opencv-4.5.4/doc/tools/doxygen_scan.py
wangzhengyang 718c41634f feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
2022-05-10 10:22:11 +08:00

49 lines
1.8 KiB
Python

import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
# traceback.print_stack()
def __repr__(self):
return '%s:%s@%s' % (self.type, self.cppname, self.anchor)
def add_to_file(files_dict, file, anchor):
anchors = files_dict.setdefault(file, [])
anchors.append(anchor)
def scan_namespace_constants(ns, ns_name, files_dict):
constants = ns.findall("./member[@kind='enumvalue']")
for c in constants:
c_name = c.find("./name").text
name = ns_name + '::' + c_name
file = c.find("./anchorfile").text
anchor = c.find("./anchor").text
#print(' CONST: {} => {}#{}'.format(name, file, anchor))
add_to_file(files_dict, file, Symbol(anchor, "const", name))
def scan_namespace_functions(ns, ns_name, files_dict):
functions = ns.findall("./member[@kind='function']")
for f in functions:
f_name = f.find("./name").text
name = ns_name + '::' + f_name
file = f.find("./anchorfile").text
anchor = f.find("./anchor").text
#print(' FN: {} => {}#{}'.format(name, file, anchor))
add_to_file(files_dict, file, Symbol(anchor, "fn", name))
def scan_class_methods(c, c_name, files_dict):
methods = c.findall("./member[@kind='function']")
for m in methods:
m_name = m.find("./name").text
name = c_name + '::' + m_name
file = m.find("./anchorfile").text
anchor = m.find("./anchor").text
#print(' Method: {} => {}#{}'.format(name, file, anchor))
add_to_file(files_dict, file, Symbol(anchor, "method", name))