Bug #247059: API to wrap inner enums and classes is not intuitive
This commit is contained in:
1 parent
0ef71e5c86
commit
13b6dc02e0
2 files changed
+23
-2
No files matched your search
@@ -617,6 +617,25 @@ class CppClass(object):
|
||||
def __repr__(self):
|
||||
return "<pybindgen.CppClass %r>" % self.full_name
|
||||
|
||||
|
||||
def add_class(self, *args, **kwargs):
|
||||
"""
|
||||
Add a nested class. See L{CppClass} for information about accepted parameters.
|
||||
"""
|
||||
assert 'outer_class' not in kwargs
|
||||
kwargs['outer_class'] = self
|
||||
return self.module.add_class(*args, **kwargs)
|
||||
|
||||
|
||||
def add_enum(self, *args, **kwargs):
|
||||
"""
|
||||
Add a nested enum. See L{Enum} for information about accepted parameters.
|
||||
"""
|
||||
assert 'outer_class' not in kwargs
|
||||
kwargs['outer_class'] = self
|
||||
return self.module.add_enum(*args, **kwargs)
|
||||
|
||||
|
||||
def get_mro(self):
|
||||
"""
|
||||
Get the method resolution order (MRO) of this class.
|
||||
|
||||
Reference in new issue
Block a user