summaryrefslogtreecommitdiff
path: root/swig/PackageProvider.i
blob: a6fc35613715e959b2cde9418ce843d83ffc1b91 (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
%inline
{
  namespace zypp 
  {
    class WrappedManagedFile 
    {
    public:
      WrappedManagedFile(ManagedFile managed_file){ mf = managed_file; }
      const std::string & asString(){ mf->asString();}
    private:
      ManagedFile mf;
    };
  }
}
%include "zypp/repo/PackageProvider.h"
%extend zypp::repo::PackageProvider {
  static zypp::WrappedManagedFile* provide( zypp::repo::RepoMediaAccess & rm, const zypp::Package_constPtr pkg )
  {
    zypp::Package::constPtr pkg_type(pkg);
    zypp::repo::DeltaCandidates dc;
    zypp::repo::PackageProvider pp(rm,pkg_type,dc);
    zypp::ManagedFile mf = pp.providePackage();
    zypp::WrappedManagedFile* res = new zypp::WrappedManagedFile(mf);
    return res;
  }
}