Discussion:
[Swig-devel] std_multimap for JavaScript
Manish Malik
2016-05-26 05:04:07 UTC
Permalink
Hi,
I want to use std_multimap, in one of our project which involve creating a
C++ library interface for Node.js. But I didn't find any std_multimap.i
within:

/usr/local/share/swig/3.0.8/javascript/

So, I am using the std_multimap.i from :

/usr/local/share/swig/3.0.8/std/std_multimap.i

by using : %include "std/std_multimap.i"

But by building the swig using:

swig -I/usr/include/ -javascript -node -Wall -Wextra -c++
myproject/myproject.i

I am getting the following error:

/usr/local/share/swig/3.0.8/std/std_multimap.i:90: Error: Syntax error in
input(3).
make: *** [all] Error 1

which turns out to be a problem at this line of std/std_multipmap.i:

%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap< _Key, _Tp,
_Compare, _Alloc >);

So, its seems like std/std_multimap.i is not compatible with javascript as
of now. My question is :

1. Does anyone have the std_multimap.i for JavaScript ? Can you please
share it with me.

2. Am I not using the std/std_multimap.i properly ? Do I need to include
some other options/command while building it ?

3. Can somebody point me to the docs for writing the language specific
interface file ? I can see that std_multimap.i are available for Python and
Ruby. So,Is their a guide to write the JavaScript specific std_multimap.i ?

PS: I haven't used SWIG before and I am quite beginner in writing interface
files.
--
Thanks,
With Regards
*Manish Malik*
William S Fulton
2016-05-28 15:18:40 UTC
Permalink
Post by Manish Malik
Hi,
I want to use std_multimap, in one of our project which involve creating a
C++ library interface for Node.js. But I didn't find any std_multimap.i
/usr/local/share/swig/3.0.8/javascript/
/usr/local/share/swig/3.0.8/std/std_multimap.i
by using : %include "std/std_multimap.i"
swig -I/usr/include/ -javascript -node -Wall -Wextra -c++
myproject/myproject.i
/usr/local/share/swig/3.0.8/std/std_multimap.i:90: Error: Syntax error in
input(3).
make: *** [all] Error 1
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap< _Key, _Tp,
_Compare, _Alloc >);
So, its seems like std/std_multimap.i is not compatible with javascript as
1. Does anyone have the std_multimap.i for JavaScript ? Can you please share
it with me.
2. Am I not using the std/std_multimap.i properly ? Do I need to include
some other options/command while building it ?
3. Can somebody point me to the docs for writing the language specific
interface file ? I can see that std_multimap.i are available for Python and
Ruby. So,Is their a guide to write the JavaScript specific std_multimap.i ?
Create a Lib/javascript/v8/std_multimap.i and base it on
Lib/javascript/v8/std_map.i and what other languages have done for
multimap, eg Lib/python/std_multimap.i. Ruby is the only other
language that has support for multimap. If you do this, please submit
it as a github patch with a runtime test for the li_std_multimap
testcase (Examples/test-suite/li_std_multimap.i). See
http://swig.org/Doc3.0/Extending.html#Extending for extending SWIG and
info on the test-suite.

William

Loading...