I would like to SWIG below C++ code to be used in Java. How can i define a typemap to convert from C++ std::map to Java map?
File.h
#pragma once
#include <map>
#include <string>
class A
{
public:
std::map<std::string, std::string> GetMap();
};
File.cpp
#include "File.h"
std::map<std::string, std::string> A::GetMap()
{
std::map<std::string, std::string> f;
// Code to populate map
return f;
}
My typemap file looks as below
%module test
%include <std_string.i>
%include <std_wstring.i>
%include <std_map.i>
%include <windows.i>
%include <typemaps.i>
#include <string>
%{
#include "File.h"
%}
%include <File.h>