Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: swig/Lib/python/std_carray.i

Issue 553095: Checkin swig binaries for win, linux and Mac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « swig/Lib/python/std_basic_string.i ('k') | swig/Lib/python/std_char_traits.i » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 %include <pycontainer.swg>
2
3
4 %fragment("StdCarrayTraits","header",fragment="StdSequenceTraits")
5 {
6 namespace swig {
7 template <class T, size_t S>
8 struct traits_asptr<std::carray<T, S> > {
9 static int asptr(PyObject *obj, std::carray<T, S> **array) {
10 return traits_asptr_stdseq<std::carray<T, S> >::asptr(obj, array);
11 }
12 };
13 }
14 }
15
16 %warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[];
17
18 %extend std::carray {
19 %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header",
20 fragment="SwigPyIterator_T",
21 fragment=SWIG_Traits_frag(_Type),
22 fragment="StdCarrayTraits") {
23 namespace swig {
24 template <> struct traits<std::carray<_Type, _Size > > {
25 typedef pointer_category category;
26 static const char* type_name() {
27 return "std::carray<" #_Type "," #_Size " >";
28 }
29 };
30 }
31 }
32
33 %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr,
34 SWIG_Traits_frag(std::carray<_Type, _Size >),
35 std::carray<_Type, _Size >);
36
37 %typemap(out,noblock=1) iterator, const_iterator {
38 $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1),
39 swig::SwigPyIterator::descriptor(),SWIG_POINTER _OWN);
40 }
41
42 inline size_t __len__() const { return self->size(); }
43
44 inline const _Type& __getitem__(size_t i) const { return (*self)[i]; }
45
46 inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; }
47
48
49 swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) {
50 return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
51 }
52 }
53
54 %include <std/std_carray.swg>
OLDNEW
« no previous file with comments | « swig/Lib/python/std_basic_string.i ('k') | swig/Lib/python/std_char_traits.i » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698