include the language specific codes first since they can contain typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
564be509ea
commit
f88acef831
9 changed files with 56 additions and 57 deletions
|
|
@ -3,10 +3,15 @@
|
||||||
%include <std_alloc.i>
|
%include <std_alloc.i>
|
||||||
%include <std_char_traits.i>
|
%include <std_char_traits.i>
|
||||||
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <string>
|
#include <string>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> >
|
||||||
|
|
@ -29,6 +34,10 @@ namespace std {
|
||||||
|
|
||||||
static const size_type npos;
|
static const size_type npos;
|
||||||
|
|
||||||
|
%traits_swigtype(_CharT);
|
||||||
|
%fragment(SWIG_Traits_frag(_CharT));
|
||||||
|
|
||||||
|
|
||||||
basic_string(const _CharT* __s, size_type __n);
|
basic_string(const _CharT* __s, size_type __n);
|
||||||
|
|
||||||
// Capacity:
|
// Capacity:
|
||||||
|
|
@ -181,20 +190,20 @@ namespace std {
|
||||||
|
|
||||||
%ignore pop();
|
%ignore pop();
|
||||||
|
|
||||||
|
|
||||||
#ifdef %swig_basic_string
|
#ifdef %swig_basic_string
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_basic_string(std::basic_string<_CharT, _Traits, _Alloc >);
|
%swig_basic_string(std::basic_string<_CharT, _Traits, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator
|
|
||||||
insert(iterator __p, _CharT __c = _CharT());
|
|
||||||
|
|
||||||
iterator
|
|
||||||
erase(iterator __position);
|
|
||||||
|
|
||||||
iterator
|
class iterator;
|
||||||
erase(iterator __first, iterator __last);
|
class reverse_iterator;
|
||||||
|
class const_iterator;
|
||||||
|
class const_reverse_iterator;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
insert(iterator __p, size_type __n, _CharT __c);
|
insert(iterator __p, size_type __n, _CharT __c);
|
||||||
|
|
@ -203,24 +212,15 @@ namespace std {
|
||||||
replace(iterator __i1, iterator __i2, const basic_string& __str);
|
replace(iterator __i1, iterator __i2, const basic_string& __str);
|
||||||
|
|
||||||
basic_string&
|
basic_string&
|
||||||
replace(iterator __i1, iterator __i2,
|
replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n);
|
||||||
const _CharT* __s, size_type __n);
|
|
||||||
|
|
||||||
basic_string&
|
|
||||||
replace(iterator __i1, iterator __i2, const _CharT* __s);
|
|
||||||
|
|
||||||
basic_string&
|
basic_string&
|
||||||
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c);
|
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c);
|
||||||
|
|
||||||
basic_string&
|
|
||||||
replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2);
|
|
||||||
|
|
||||||
basic_string&
|
basic_string&
|
||||||
replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2);
|
replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2);
|
||||||
|
|
||||||
basic_string&
|
|
||||||
replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2);
|
|
||||||
|
|
||||||
basic_string&
|
basic_string&
|
||||||
replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2);
|
replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@
|
||||||
allocator_type get_allocator() const;
|
allocator_type get_allocator() const;
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
|
class iterator;
|
||||||
|
class reverse_iterator;
|
||||||
|
class const_iterator;
|
||||||
|
class const_reverse_iterator;
|
||||||
|
|
||||||
iterator begin();
|
iterator begin();
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
iterator end();
|
iterator end();
|
||||||
|
|
@ -45,7 +50,6 @@
|
||||||
void resize(size_type new_size);
|
void resize(size_type new_size);
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator insert(iterator pos);
|
|
||||||
iterator erase(iterator pos);
|
iterator erase(iterator pos);
|
||||||
iterator erase(iterator first, iterator last);
|
iterator erase(iterator first, iterator last);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -78,12 +78,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp, _Alloc >);
|
||||||
|
|
||||||
%std_deque_methods(deque);
|
|
||||||
|
|
||||||
#ifdef %swig_deque_methods
|
#ifdef %swig_deque_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_deque_methods(std::deque<_Tp, _Alloc >);
|
%swig_deque_methods(std::deque<_Tp, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_deque_methods(deque);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp, class _Alloc >
|
template<class _Tp, class _Alloc >
|
||||||
|
|
@ -115,12 +115,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp*, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp*, _Alloc >);
|
||||||
|
|
||||||
%std_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
|
||||||
|
|
||||||
#ifdef %swig_deque_methods_val
|
#ifdef %swig_deque_methods_val
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
%swig_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp, _Alloc >);
|
||||||
|
|
||||||
%std_list_methods(list);
|
|
||||||
|
|
||||||
#ifdef %swig_list_methods
|
#ifdef %swig_list_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_list_methods(std::list<_Tp, _Alloc >);
|
%swig_list_methods(std::list<_Tp, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_list_methods(list);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp, class _Alloc >
|
template<class _Tp, class _Alloc >
|
||||||
|
|
@ -127,12 +127,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp*, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp*, _Alloc >);
|
||||||
|
|
||||||
%std_list_methods_val(list);
|
|
||||||
|
|
||||||
#ifdef %swig_list_methods_val
|
#ifdef %swig_list_methods_val
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_list_methods_val(std::list<_Tp*, _Alloc >);
|
%swig_list_methods_val(std::list<_Tp*, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_list_methods_val(list);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
size_type count(const key_type& x) const;
|
size_type count(const key_type& x) const;
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator insert(iterator position, const value_type& x);
|
// iterator insert(iterator position, const value_type& x);
|
||||||
void erase(iterator position);
|
void erase(iterator position);
|
||||||
void erase(iterator first, iterator last);
|
void erase(iterator first, iterator last);
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
%std_map_methods_common(map);
|
%std_map_methods_common(map);
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator insert(const value_type& x);
|
// iterator insert(const value_type& x);
|
||||||
#endif
|
#endif
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
@ -114,12 +114,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<_Key, _Tp, _Compare, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<_Key, _Tp, _Compare, _Alloc >);
|
||||||
|
|
||||||
%std_map_methods(map);
|
|
||||||
|
|
||||||
#ifdef %swig_map_methods
|
#ifdef %swig_map_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_map_methods(std::map<_Key, _Tp, _Compare, _Alloc >);
|
%swig_map_methods(std::map<_Key, _Tp, _Compare, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_map_methods(map);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,8 @@
|
||||||
%std_map_methods_common(mmap);
|
%std_map_methods_common(mmap);
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
pair<iterator,bool> insert(const value_type& x);
|
std::pair<iterator,iterator> equal_range(const key_type& x);
|
||||||
pair<iterator,iterator> equal_range(const key_type& x);
|
std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
|
||||||
pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
|
|
||||||
#endif
|
#endif
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
@ -76,11 +75,11 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
||||||
|
|
||||||
%std_multimap_methods(multimap);
|
|
||||||
|
|
||||||
#ifdef %swig_multimap_methods
|
#ifdef %swig_multimap_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_multimap_methods(std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
%swig_multimap_methods(std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_multimap_methods(multimap);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
|
|
||||||
%define %std_multiset_methods(multiset...)
|
%define %std_multiset_methods(multiset...)
|
||||||
%std_set_methods_common(multiset);
|
%std_set_methods_common(multiset);
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
|
||||||
pair<iterator,bool> insert(iterator pos);
|
|
||||||
#endif
|
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,11 +71,11 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
|
||||||
|
|
||||||
%std_multiset_methods(multiset);
|
|
||||||
|
|
||||||
#ifdef %swig_multiset_methods
|
#ifdef %swig_multiset_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >);
|
%swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_multiset_methods(multiset);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
%include <std_container.i>
|
%include <std_container.i>
|
||||||
|
%include <std_pair.i>
|
||||||
|
|
||||||
// Set
|
// Set
|
||||||
%define %std_set_methods_common(set...)
|
%define %std_set_methods_common(set...)
|
||||||
|
|
@ -12,25 +13,20 @@
|
||||||
size_type count(const key_type& x) const;
|
size_type count(const key_type& x) const;
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator insert(iterator pos, const value_type& x);
|
void erase(iterator pos);
|
||||||
void insert(iterator pos, size_type n, const value_type& x);
|
void erase(iterator first, iterator last);
|
||||||
iterator erase(iterator pos);
|
|
||||||
iterator erase(iterator first, iterator last);
|
|
||||||
|
|
||||||
iterator find(const key_type& x) const;
|
iterator find(const key_type& x) const;
|
||||||
iterator lower_bound(const key_type& x) const;
|
iterator lower_bound(const key_type& x) const;
|
||||||
iterator upper_bound(const key_type& x) const;
|
iterator upper_bound(const key_type& x) const;
|
||||||
std::pair<iterator,iterator> equal_range(const key_type& x);
|
std::pair<iterator,iterator> equal_range(const key_type& x);
|
||||||
iterator begin() const;
|
|
||||||
iterator end() const;
|
|
||||||
#endif
|
#endif
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
%define %std_set_methods(set...)
|
%define %std_set_methods(set...)
|
||||||
%std_set_methods_common(set);
|
%std_set_methods_common(set);
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
pair<iterator,bool> insert(const value_type& __x);
|
std::pair<iterator,bool> insert(const value_type& __x);
|
||||||
iterator insert(iterator pos);
|
|
||||||
#endif
|
#endif
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
@ -95,11 +91,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >);
|
||||||
|
|
||||||
%std_set_methods(set);
|
|
||||||
|
|
||||||
#ifdef %swig_set_methods
|
#ifdef %swig_set_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_set_methods(std::set<_Key, _Compare, _Alloc >);
|
%swig_set_methods(std::set<_Key, _Compare, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_set_methods(set);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,12 +85,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp, _Alloc >);
|
||||||
|
|
||||||
%std_vector_methods(vector);
|
|
||||||
|
|
||||||
#ifdef %swig_vector_methods
|
#ifdef %swig_vector_methods
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods(std::vector<_Tp, _Alloc >);
|
%swig_vector_methods(std::vector<_Tp, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_vector_methods(vector);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ***
|
// ***
|
||||||
|
|
@ -126,12 +126,12 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp*, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp*, _Alloc >);
|
||||||
|
|
||||||
%std_vector_methods_val(vector);
|
|
||||||
|
|
||||||
#ifdef %swig_vector_methods_val
|
#ifdef %swig_vector_methods_val
|
||||||
// Add swig/language extra methods
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods_val(std::vector<_Tp*, _Alloc >);
|
%swig_vector_methods_val(std::vector<_Tp*, _Alloc >);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
%std_vector_methods_val(vector);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ***
|
// ***
|
||||||
|
|
@ -167,16 +167,18 @@ namespace std {
|
||||||
|
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool, _Alloc >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool, _Alloc >);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods_val
|
||||||
|
// Add swig/language extra methods
|
||||||
|
%swig_vector_methods_val(std::vector<bool, _Alloc >);
|
||||||
|
#endif
|
||||||
|
|
||||||
%std_vector_methods_val(vector);
|
%std_vector_methods_val(vector);
|
||||||
|
|
||||||
#if defined(SWIG_STD_MODERN_STL) && !defined(SWIG_STD_NOMODERN_STL)
|
#if defined(SWIG_STD_MODERN_STL) && !defined(SWIG_STD_NOMODERN_STL)
|
||||||
void flip();
|
void flip();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef %swig_vector_methods_val
|
|
||||||
// Add swig/language extra methods
|
|
||||||
%swig_vector_methods_val(std::vector<bool, _Alloc >);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue