summaryrefslogtreecommitdiff
path: root/bindings/swig/templates.i
blob: b7f16348e07e94fb037700348b66feaa9deee3e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%include <stl.i>
%include <std_map.i>
%include <std_list.i>

%include <std_pair.i>
%include <std_multimap.i>

/*
Include SWModule and DirEntry here, so that it will be able to appear below
*/
%{
#include "swmodule.h"
#include "filemgr.h"
%}

/* 
These are the stl templates that are used throughout Sword. Some have more
than one name in Sword, depending on context. However, these are all wrapped with the one class.
For example, sword::AttributeValueMap is the same as sword::ConfigEntMap
Both are wrapped as the former, however
*/
%inline %{
typedef std::map< sword::SWBuf, sword::SWBuf > AttributeValueMap;
typedef std::map< sword::SWBuf, AttributeValueMap> AttributeListMap;
typedef std::map< sword::SWBuf, AttributeListMap> AttributetypeListMap; 
%}

/* Used by SWModule and SWConfig */
%template() std::pair <sword::SWBuf, sword::SWBuf>;
%template(AttributeValueMap) std::map < sword::SWBuf, sword::SWBuf >;

/* Used by SWModule */
%template() std::pair <sword::SWBuf, AttributeValueMap>;
%template(AttributeListMap) std::map < sword::SWBuf, AttributeValueMap>;
%template() std::pair < sword::SWBuf, AttributeListMap>;
%template(AttributeTypeListMap) std::map < sword::SWBuf, AttributeListMap>;

/* Used by SWConfig */
%template(SectionMapMultiMap) std::multimap < sword::SWBuf, AttributeValueMap >;

/* Used by SWMgr */
%template() std::pair<sword::SWBuf, sword::SWModule*>;
%template(ModuleMap) std::map<sword::SWBuf, sword::SWModule*>;

/* Used by SWMgr and LocaleMgr */
%template(StringVector) std::vector < sword::SWBuf >;

/* Used by xmltag */
%template(StringList) std::list < sword::SWBuf >;


/* Used by InstallMgr */
#ifndef EXCLUDE_INSTALLMGR
%{
#include "installmgr.h"
%}
%template() std::pair<sword::SWBuf, sword::InstallSource*>;
%template(InstallSourceMap) std::map<sword::SWBuf, sword::InstallSource*>;
%template() std::pair<sword::SWModule *, int>;
%template() std::map<sword::SWModule *, int>;
#endif

/* Used by DirEntry */
%template(DirEntryVector) std::vector < sword::DirEntry > ;