summaryrefslogtreecommitdiff
path: root/swig/PoolQuery.i
blob: 05ff58450230b249229bd2a325b2e76c47f17ee3 (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
%ignore zypp::PoolQuery::operator<<;
%ignore zypp::detail::operator<<;
%ignore zypp::dumpOn;
%ignore zypp::detail::dumpOn;
%ignore operator<<;
%include <zypp/PoolQuery.h>
%include "std_vector.i"
namespace std {
       %template(PoolItemVector) vector<zypp::PoolItem>;
}
namespace zypp
{
    namespace detail
    {
        %ignore operator<<;
    }
}
%{
#include <vector>
using std::vector;
%}

#ifdef SWIGPYTHON
%extend  zypp::PoolQuery {
std::vector<zypp::PoolItem>  queryResults (zypp::ResPool pool)
{
#define for_(IT,BEG,END) for ( decltype(BEG) IT = BEG; IT != END; ++IT )
    std::vector<zypp::PoolItem> items;
    for_(it, self->begin(), self->end())
    {
        PoolItem pi(*it);
        items.push_back(pi);
    }

    return items;
}
}
#endif