From 035fc294741da459c5b44aea6fdfada208392d94 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Wed, 30 Mar 2011 18:44:36 +0100 Subject: [PATCH] Modular bindings: add the std::ios::openmode constants --- bindings/python/ns3modulegen-modular.py | 2 ++ bindings/python/ns3modulegen_core_customizations.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/bindings/python/ns3modulegen-modular.py b/bindings/python/ns3modulegen-modular.py index 9547e287a..2f5f178d1 100644 --- a/bindings/python/ns3modulegen-modular.py +++ b/bindings/python/ns3modulegen-modular.py @@ -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) diff --git a/bindings/python/ns3modulegen_core_customizations.py b/bindings/python/ns3modulegen_core_customizations.py index 419441fd7..218cae556 100644 --- a/bindings/python/ns3modulegen_core_customizations.py +++ b/bindings/python/ns3modulegen_core_customizations.py @@ -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")