@@ -384,8 +384,8 @@ class CppBaseDecl(dict):
384
384
385
385
"""
386
386
387
- def __init__ (self ):
388
- self ["access" ] = "private"
387
+ def __init__ (self , default_access ):
388
+ self ["access" ] = default_access
389
389
self ["class" ] = ""
390
390
self ["decl_name" ] = ""
391
391
self ["decltype" ] = False
@@ -530,13 +530,13 @@ def _parse_cppclass_name(c, stack):
530
530
return i
531
531
532
532
533
- def _parse_cpp_base (stack ):
534
- debug_print ("Parsing base: %s" , stack )
533
+ def _parse_cpp_base (stack , default_access ):
534
+ debug_print ("Parsing base: %s (access %s) " , stack , default_access )
535
535
inherits = []
536
536
i = 0
537
537
sl = len (stack )
538
538
init = True
539
- base = CppBaseDecl ()
539
+ base = CppBaseDecl (default_access )
540
540
require_ending = False
541
541
while i < sl :
542
542
t = stack [i ]
@@ -558,7 +558,7 @@ def _parse_cpp_base(stack):
558
558
559
559
if t == "," :
560
560
inherits .append (base )
561
- base = CppBaseDecl ()
561
+ base = CppBaseDecl (default_access )
562
562
init = True
563
563
require_ending = False
564
564
continue
@@ -681,7 +681,7 @@ def _lookup_type(self, name):
681
681
if n ["name" ] == name :
682
682
return {"raw_type" : self ["name" ] + "::" + n ["name" ], "type" : n ["name" ]}
683
683
684
- def __init__ (self , nameStack , curTemplate , doxygen , location ):
684
+ def __init__ (self , nameStack , curTemplate , doxygen , location , defaultAccess ):
685
685
self ["nested_classes" ] = []
686
686
self ["parent" ] = None
687
687
self ["abstract" ] = False
@@ -706,7 +706,7 @@ def __init__(self, nameStack, curTemplate, doxygen, location):
706
706
# consume bases
707
707
baseStack = nameStack [n :]
708
708
if baseStack :
709
- self ["inherits" ] = _parse_cpp_base (baseStack )
709
+ self ["inherits" ] = _parse_cpp_base (baseStack , defaultAccess )
710
710
else :
711
711
self ["inherits" ] = []
712
712
@@ -838,7 +838,7 @@ class CppUnion(CppClass):
838
838
"""
839
839
840
840
def __init__ (self , nameStack , doxygen , location ):
841
- CppClass .__init__ (self , nameStack , None , doxygen , location )
841
+ CppClass .__init__ (self , nameStack , None , doxygen , location , "public" )
842
842
self ["members" ] = self ["properties" ]["public" ]
843
843
844
844
def transform_to_union_keys (self ):
@@ -2487,6 +2487,7 @@ def _evaluate_class_stack(self):
2487
2487
self .curTemplate ,
2488
2488
self ._get_stmt_doxygen (),
2489
2489
self ._get_location (self .nameStack ),
2490
+ self .curAccessSpecifier ,
2490
2491
)
2491
2492
newClass ["declaration_method" ] = self .nameStack [0 ]
2492
2493
self .classes_order .append (newClass ) # good idea to save ordering
0 commit comments