summaryrefslogtreecommitdiff
path: root/swig/PackageProvider.i
blob: b844a6502f5847e6c80c3b8cf84755c447704be8 (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(){ return 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;
  }
}