~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Lib/python/std_multimap.i

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
%fragment("StdMultimapTraits","header",fragment="StdSequenceTraits")
7
7
{
8
8
  namespace swig {
9
 
    template <class PySeq, class K, class T >
 
9
    template <class SwigPySeq, class K, class T >
10
10
    inline void 
11
 
    assign(const PySeq& pyseq, std::multimap<K,T > *multimap) {
 
11
    assign(const SwigPySeq& swigpyseq, std::multimap<K,T > *multimap) {
12
12
      typedef typename std::multimap<K,T>::value_type value_type;
13
 
      typename PySeq::const_iterator it = pyseq.begin();
14
 
      for (;it != pyseq.end(); ++it) {
 
13
      typename SwigPySeq::const_iterator it = swigpyseq.begin();
 
14
      for (;it != swigpyseq.end(); ++it) {
15
15
        multimap->insert(value_type(it->first, it->second));
16
16
      }
17
17
    }
22
22
      static int asptr(PyObject *obj, std::multimap<K,T> **val) {
23
23
        int res = SWIG_ERROR;
24
24
        if (PyDict_Check(obj)) {
25
 
          PyObject_var items = PyObject_CallMethod(obj,(char *)"items",NULL);
 
25
          SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL);
26
26
          return traits_asptr_stdseq<std::multimap<K,T>, std::pair<K, T> >::asptr(items, val);
27
27
        } else {
28
28
          multimap_type *p;
55
55
          }
56
56
          PyObject *obj = PyDict_New();
57
57
          for (const_iterator i= multimap.begin(); i!= multimap.end(); ++i) {
58
 
            swig::PyObject_var key = swig::from(i->first);
59
 
            swig::PyObject_var val = swig::from(i->second);
 
58
            swig::SwigVar_PyObject key = swig::from(i->first);
 
59
            swig::SwigVar_PyObject val = swig::from(i->second);
60
60
            PyDict_SetItem(obj, key, val);
61
61
          }
62
62
          return obj;