Small fixes for documentation checking script

This commit is contained in:
Andrey Kamaev 2012-05-28 15:29:21 +00:00
parent ddd9a99c66
commit 18a8721f49
3 changed files with 17 additions and 1 deletions

View File

@ -37,6 +37,11 @@ doc_signatures_whitelist = [
# these are even non-template
"gpu::DeviceInfo", "gpu::GpuMat", "gpu::TargetArchs", "gpu::FeatureSet"]
defines = ["cvGraphEdgeIdx", "cvFree", "CV_Assert", "cvSqrt", "cvGetGraphVtx", "cvGraphVtxIdx",
# not a real function but behaves as function
"Mat.size"
]
synonims = {
"StarDetector" : ["StarFeatureDetector"],
"MSER" : ["MserFeatureDetector"],
@ -191,6 +196,8 @@ def process_module(module, path):
namespaces.append(namespace)
else:
funcs.append(decl)
# if "RNG" in decl[0]:
# print decl
clsnamespaces = []
# process classes
@ -391,6 +398,8 @@ def process_module(module, path):
decls = doc.get("decls")
if not decls:
continue
# if "RNG" in name:
# print name, decls
for signature in decls:
if signature[0] == "C" or signature[0] == "C++":
if "template" in (signature[2][1] or ""):
@ -434,7 +443,11 @@ def process_module(module, path):
for d in doc.get("decls", []):
if d[-1] != DOCUMENTED_MARKER:
if d[0] == "C" or d[0] =="C++" or (do_python_crosscheck and d[0].startswith("Python")):
if d[0][0] == 'C' and d[2][0][3:] in defines:
#TODO: need to find a way to verify #define's
continue
logerror(ERROR_011_UNKNOWNFUNC, d[0] + " function is documented but is not found in OpenCV headers. It is documented as:\n\t" + d[1], doc)
#print d[2][0][3:]
# end of process_module
if __name__ == "__main__":

View File

@ -160,7 +160,7 @@ Sub-pixel accurate size of a rectangle.
Height of the rectangle
.. ocv:cfunction:: CvSize2D32f cvSize2D23f( float width, float height )
.. ocv:cfunction:: CvSize2D32f cvSize2D32f( double width, double height )
constructs ``CvSize2D32f`` structure.

View File

@ -419,6 +419,9 @@ class CppHeaderParser(object):
print "Error at %d: no args in '%s'" % (self.lineno, decl_str)
sys.exit(-1)
decl_start = decl_str[:args_begin].strip()
# TODO: normalize all type of operators
if decl_start.endswith("()"):
decl_start = decl_start[0:-2].rstrip() + " ()"
# constructor/destructor case
if bool(re.match(r'(\w+::)*(?P<x>\w+)::~?(?P=x)', decl_start)):