|
From: Marc L. <ml...@py...> - 2006-10-12 22:49:26
|
Hi, new mailing list reader (and new SWIG user) here. =20 I'm involving in bringing a fairly large C++ codebase to SWIG, primarily for C# wrapping, and possibly for other languages in the future (maybe Lua, Ruby, Python, Perl, etc.). =20 Our C++ code is organized into namespaces about 2 levels deep, something like this: =20 company::util company::moduleA company::moduleB and so on. =20 I'd like that to map to appropriate namespaces on the C# side, so company::moduleA::classX in C++ maps to company.moduleA.classX proxy in C# (and the same for the other modules). Is this possible? Is this advisable? =20 I'm relatively new to SWIG so apologies if I seem slow or on the wrong track. I started with an interface file defining two %modules, one for util, one for moduleA. But they aren't in a module named company. And by default, the generated wrapping to C# places everything in the global namespace. =20 I tried the -namespace option, and I can place all of the generated C# code into a company namespace. But the sub-namespaces (util, moduleA) do not appear. Is there a way to nest namespaces in the generated C# proxy code? =20 Must I move to some sort of solution which puts a %module in each SWIG invocation (with a different -namespace command line option), then put them all together somehow at the end? =20 If anyone can provide links to examples of this nature, I'm pretty sure I can follow along. I just haven't seen anything comparable in the documentation or online searches. =20 Thanks! =20 --=20 Marc Lepage the PYXIS innovation - common ground for digital earth www.pyxisinnovation.com <http://www.pyxisinnovation.com/>=20 =20 |