bindings: (partial fix #2451) Handle std::_Ios_Openmode typedef

std::_Ios_Openmode is a typedef of std::ios_base::openmode bitmask type.
This mapping needs to be provided to the type handler.  The previous
mapping was for std::ios::openmode (ios is a subclass of ios_base),
but the use of subclass here no longer works.  Thanks to Gustavo
Carneiro for a hint of where to address this issue in the bindings.
This commit is contained in:
Tom Henderson
2018-01-05 09:19:45 -08:00
parent 5d5f67faa3
commit 05ab57f865

View File

@@ -412,7 +412,7 @@ def add_std_ofstream(module):
class IosOpenmodeParam(Parameter):
DIRECTIONS = [Parameter.DIRECTION_IN]
CTYPES = ['std::ios::openmode', 'std::_Ios_Openmode']
CTYPES = ['std::ios_base::openmode', 'std::_Ios_Openmode']
def convert_c_to_python(self, wrapper):
assert isinstance(wrapper, ReverseWrapperBase)
@@ -420,7 +420,7 @@ class IosOpenmodeParam(Parameter):
def convert_python_to_c(self, wrapper):
assert isinstance(wrapper, ForwardWrapperBase)
name = wrapper.declarations.declare_variable("std::ios::openmode", self.name, self.default_value)
name = wrapper.declarations.declare_variable("std::ios_base::openmode", self.name, self.default_value)
wrapper.parse_params.add_parameter('i', ['&'+name], self.name, optional=bool(self.default_value))
wrapper.call_params.append(name)