@@ -452,7 +452,9 @@ def normalize_ctype_name(typename):
452
452
for prefix_to_remove in PREFIXES_TO_REMOVE :
453
453
if typename .startswith (prefix_to_remove ):
454
454
typename = typename [len (prefix_to_remove ):]
455
- return typename .replace ("::" , "_" )
455
+ if typename .endswith ('&' ):
456
+ typename = typename [:- 1 ]
457
+ return typename .strip ()
456
458
457
459
458
460
def is_tuple (typename ):
@@ -482,10 +484,17 @@ def get_template_instantiation_type(typename):
482
484
483
485
484
486
def convert_ctype_name_to_pytype_name (typename , classnames ):
485
- typename = normalize_ctype_name (typename )
487
+ typename = normalize_ctype_name (typename . strip () )
486
488
pytype = CTYPE_TO_PYTYPE_MAP .get (typename )
487
489
if pytype is not None :
488
490
return pytype
491
+
492
+ # GAPI types
493
+ if typename .startswith ("GArray_" ) or typename .startswith ("GArray<" ):
494
+ return "GArray"
495
+ if typename .startswith ("GOpaque_" ) or typename .startswith ("GOpaque<" ):
496
+ return "GOpaque"
497
+
489
498
if is_sequence_type (typename ):
490
499
if is_template_class_instantiation (typename ):
491
500
sequence_pytype = convert_ctype_name_to_pytype_name (
@@ -517,7 +526,7 @@ def convert_ctype_name_to_pytype_name(typename, classnames):
517
526
for classname in classnames :
518
527
if classname .endswith ('_' + typename ):
519
528
return classname
520
- return typename
529
+ return typename . replace ( "::" , "_" )
521
530
522
531
523
532
def get_named_params_info (all_classes , args ):
0 commit comments