4f6c06c13aa05aa0139377ced0995519332a7396
[platform/upstream/libzypp-bindings.git] / swig / RepoInfo.i
1 #ifdef SWIGPERL5
2 #else
3 %template(UrlSet) std::set<zypp::Url>;
4 #endif
5
6 namespace zypp
7 {
8   namespace repo
9   {
10     %ignore operator==;
11     %ignore operator!=;
12     %ignore operator<<;
13     %ignore operator<;
14   }
15   typedef std::list<Url> UrlSet;
16 }
17
18 %ignore zypp::repo::RepoInfoBase::dumpOn(std::ostream &) const;
19 %ignore zypp::repo::RepoInfoBase::dumpAsIniOn(std::ostream &) const;
20 %ignore zypp::repo::RepoInfoBase::dumpAsXmlOn(std::ostream &) const;
21 %include <zypp/repo/RepoInfoBase.h>
22
23 // This is due to a typo in libzypp < 5.4.0
24 %ignore zypp::RepoInfo::defaultPrioity();
25
26 %ignore zypp::RepoInfo::dumpOn(std::ostream &) const;
27 %ignore zypp::RepoInfo::dumpAsIniOn(std::ostream &) const;
28 %ignore zypp::RepoInfo::dumpAsXmlOn(std::ostream &) const;
29
30 %include <zypp/RepoInfo.h>
31 typedef std::list<zypp::RepoInfo> RepoInfoList;
32 %template(RepoInfoList) std::list<zypp::RepoInfo>;
33
34 %extend zypp::RepoInfo 
35 {
36         std::string dump(void) const
37         {
38                 std::ostringstream str;
39                 self->dumpOn(str);
40                 return str.str();
41         }
42
43         std::string dumpAsIni(void) const
44         {
45                 std::ostringstream str;
46                 self->dumpAsIniOn(str);
47                 return str.str();
48         }
49
50         std::string dumpAsXML(void) const
51         {
52                 std::ostringstream str;
53                 self->dumpAsXmlOn(str);
54                 return str.str();
55         }
56 }