Modular bindings: add the std::ios::openmode constants

This commit is contained in:
Gustavo J. A. M. Carneiro
2011-03-30 18:44:36 +01:00
parent 0107996806
commit 035fc29474
2 changed files with 6 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ def main(argv):
root_module.set_name(extension_name)
root_module.add_include('"ns3/%s-module.h"' % module_name)
ns3modulegen_core_customizations.add_std_ios_openmode(root_module)
# -----------
module_apidefs.register_types(root_module)

View File

@@ -418,7 +418,11 @@ def add_std_ofstream(module):
ofstream.add_constructor([Parameter.new("const char *", 'filename'),
Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
ofstream.add_method('close', None, [])
add_std_ios_openmode(module)
def add_std_ios_openmode(module):
import pybindgen.typehandlers.base
for alias in "std::_Ios_Openmode", "std::ios::openmode":
pybindgen.typehandlers.base.param_type_matcher.add_type_alias(alias, "int")