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_char_traits.i>
|
||||
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
%}
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
#endif
|
||||
|
||||
|
||||
namespace std {
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> >
|
||||
|
|
@ -29,6 +34,10 @@ namespace std {
|
|||
|
||||
static const size_type npos;
|
||||
|
||||
%traits_swigtype(_CharT);
|
||||
%fragment(SWIG_Traits_frag(_CharT));
|
||||
|
||||
|
||||
basic_string(const _CharT* __s, size_type __n);
|
||||
|
||||
// Capacity:
|
||||
|
|
@ -181,20 +190,20 @@ namespace std {
|
|||
|
||||
%ignore pop();
|
||||
|
||||
|
||||
#ifdef %swig_basic_string
|
||||
// Add swig/language extra methods
|
||||
%swig_basic_string(std::basic_string<_CharT, _Traits, _Alloc >);
|
||||
#endif
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
iterator
|
||||
insert(iterator __p, _CharT __c = _CharT());
|
||||
|
||||
iterator
|
||||
erase(iterator __position);
|
||||
|
||||
class iterator;
|
||||
class reverse_iterator;
|
||||
class const_iterator;
|
||||
class const_reverse_iterator;
|
||||
|
||||
iterator
|
||||
erase(iterator __first, iterator __last);
|
||||
|
||||
void
|
||||
insert(iterator __p, size_type __n, _CharT __c);
|
||||
|
|
@ -203,24 +212,15 @@ namespace std {
|
|||
replace(iterator __i1, iterator __i2, const basic_string& __str);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2,
|
||||
const _CharT* __s, size_type __n);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, const _CharT* __s);
|
||||
replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2);
|
||||
|
||||
basic_string&
|
||||
replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@
|
|||
allocator_type get_allocator() const;
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
class iterator;
|
||||
class reverse_iterator;
|
||||
class const_iterator;
|
||||
class const_reverse_iterator;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
|
|
@ -45,7 +50,6 @@
|
|||
void resize(size_type new_size);
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
iterator insert(iterator pos);
|
||||
iterator erase(iterator pos);
|
||||
iterator erase(iterator first, iterator last);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp, _Alloc >);
|
||||
|
||||
%std_deque_methods(deque);
|
||||
|
||||
#ifdef %swig_deque_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_deque_methods(std::deque<_Tp, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_deque_methods(deque);
|
||||
};
|
||||
|
||||
template<class _Tp, class _Alloc >
|
||||
|
|
@ -115,12 +115,12 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp*, _Alloc >);
|
||||
|
||||
%std_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
||||
|
||||
#ifdef %swig_deque_methods_val
|
||||
// Add swig/language extra methods
|
||||
%swig_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_deque_methods_val(std::deque<_Tp*, _Alloc >);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,13 +89,13 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp, _Alloc >);
|
||||
|
||||
%std_list_methods(list);
|
||||
|
||||
#ifdef %swig_list_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_list_methods(std::list<_Tp, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_list_methods(list);
|
||||
};
|
||||
|
||||
template<class _Tp, class _Alloc >
|
||||
|
|
@ -127,12 +127,12 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp*, _Alloc >);
|
||||
|
||||
%std_list_methods_val(list);
|
||||
|
||||
#ifdef %swig_list_methods_val
|
||||
// Add swig/language extra methods
|
||||
%swig_list_methods_val(std::list<_Tp*, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_list_methods_val(list);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
size_type count(const key_type& x) const;
|
||||
|
||||
#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 first, iterator last);
|
||||
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
%std_map_methods_common(map);
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
iterator insert(const value_type& x);
|
||||
// iterator insert(const value_type& x);
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
|
|
@ -113,13 +113,13 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<_Key, _Tp, _Compare, _Alloc >);
|
||||
|
||||
%std_map_methods(map);
|
||||
|
||||
#ifdef %swig_map_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_map_methods(std::map<_Key, _Tp, _Compare, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_map_methods(map);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@
|
|||
%std_map_methods_common(mmap);
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
pair<iterator,bool> insert(const value_type& x);
|
||||
pair<iterator,iterator> equal_range(const key_type& x);
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
|
||||
std::pair<iterator,iterator> equal_range(const key_type& x);
|
||||
std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const;
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
|
|
@ -76,11 +75,11 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
||||
|
||||
%std_multimap_methods(multimap);
|
||||
|
||||
#ifdef %swig_multimap_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_multimap_methods(std::multimap<_Key, _Tp, _Compare, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_multimap_methods(multimap);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@
|
|||
|
||||
%define %std_multiset_methods(multiset...)
|
||||
%std_set_methods_common(multiset);
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
pair<iterator,bool> insert(iterator pos);
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
|
||||
|
|
@ -73,12 +70,12 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >);
|
||||
|
||||
%std_multiset_methods(multiset);
|
||||
|
||||
#ifdef %swig_multiset_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_multiset_methods(multiset);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
//
|
||||
|
||||
%include <std_container.i>
|
||||
%include <std_pair.i>
|
||||
|
||||
// Set
|
||||
%define %std_set_methods_common(set...)
|
||||
|
|
@ -12,25 +13,20 @@
|
|||
size_type count(const key_type& x) const;
|
||||
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
iterator insert(iterator pos, const value_type& x);
|
||||
void insert(iterator pos, size_type n, const value_type& x);
|
||||
iterator erase(iterator pos);
|
||||
iterator erase(iterator first, iterator last);
|
||||
void erase(iterator pos);
|
||||
void erase(iterator first, iterator last);
|
||||
|
||||
iterator find(const key_type& x) const;
|
||||
iterator lower_bound(const key_type& x) const;
|
||||
iterator upper_bound(const key_type& x) const;
|
||||
std::pair<iterator,iterator> equal_range(const key_type& x);
|
||||
iterator begin() const;
|
||||
iterator end() const;
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %std_set_methods(set...)
|
||||
%std_set_methods_common(set);
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
pair<iterator,bool> insert(const value_type& __x);
|
||||
iterator insert(iterator pos);
|
||||
std::pair<iterator,bool> insert(const value_type& __x);
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
|
|
@ -94,12 +90,13 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >);
|
||||
|
||||
%std_set_methods(set);
|
||||
|
||||
#ifdef %swig_set_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_set_methods(std::set<_Key, _Compare, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_set_methods(set);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,13 +84,13 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp, _Alloc >);
|
||||
|
||||
%std_vector_methods(vector);
|
||||
|
||||
#ifdef %swig_vector_methods
|
||||
// Add swig/language extra methods
|
||||
%swig_vector_methods(std::vector<_Tp, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_vector_methods(vector);
|
||||
};
|
||||
|
||||
// ***
|
||||
|
|
@ -126,12 +126,12 @@ namespace std {
|
|||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp*, _Alloc >);
|
||||
|
||||
%std_vector_methods_val(vector);
|
||||
|
||||
#ifdef %swig_vector_methods_val
|
||||
// Add swig/language extra methods
|
||||
%swig_vector_methods_val(std::vector<_Tp*, _Alloc >);
|
||||
#endif
|
||||
|
||||
%std_vector_methods_val(vector);
|
||||
};
|
||||
|
||||
// ***
|
||||
|
|
@ -167,16 +167,18 @@ namespace std {
|
|||
|
||||
%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);
|
||||
|
||||
#if defined(SWIG_STD_MODERN_STL) && !defined(SWIG_STD_NOMODERN_STL)
|
||||
void flip();
|
||||
#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