libzypp  13.10.6
WebpinResult.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 
14 #include "zypp/base/Logger.h"
15 #include "zypp/ws/WebpinResult.h"
16 
17 using namespace std;
18 
20 namespace zypp
21 {
22 namespace ws
23 {
24 
26  //
27  // CLASS NAME : WebpinResult::Impl
28  //
31  {
32  Impl()
33  : priority(0)
34  {}
35 
37  {
38  //MIL << std::endl;
39  }
40  public:
41  std::string name;
45  string summary;
46  string distro;
47  int priority;
48 
49  private:
50  friend Impl * rwcowClone<Impl>( const Impl * rhs );
52  Impl * clone() const
53  { return new Impl( *this ); }
54  };
55 
57  inline std::ostream & operator<<( std::ostream & str, const WebpinResult::Impl & obj )
58  {
59  return str << "WebpinResult::Impl";
60  }
61 
62  WebpinResult::WebpinResult()
63  : _pimpl( new Impl() )
64  {}
65 
67  {
68  //MIL << std::endl;
69  }
70 
71  WebpinResult & WebpinResult::setName( const std::string &name )
72  {
73  _pimpl->name = name;
74  return *this;
75  }
76 
77  std::string WebpinResult::name() const
78  {
79  return _pimpl->name;
80  }
81 
82 
84  {
85  return _pimpl->repourl;
86  }
87 
89  {
90  _pimpl->repourl = url;
91  return *this;
92  }
93 
94  WebpinResult & WebpinResult::setDistribution( const std::string &distro )
95  {
96  _pimpl->distro = distro;
97  return *this;
98  }
99 
100  std::string WebpinResult::distribution() const
101  {
102  return _pimpl->distro;
103  }
104 
105  WebpinResult & WebpinResult::setSummary( const std::string &summary )
106  {
107  _pimpl->summary = summary;
108  return *this;
109  }
110 
111  std::string WebpinResult::summary() const
112  {
113  return _pimpl->summary;
114  }
115 
117  {
118  _pimpl->priority = priority;
119  return *this;
120  }
121 
123  {
124  return _pimpl->priority;
125  }
126 
127 
129  {
130  _pimpl->edition = edition;
131  return *this;
132  }
133 
135  {
136  return _pimpl->edition;
137  }
138 
140  {
141  _pimpl->checksum = checksum;
142  return *this;
143  }
144 
146  {
147  return _pimpl->checksum;
148  }
149 
150 
151  std::ostream & WebpinResult::dumpOn( std::ostream & str ) const
152  {
153  str << "- name : " << name() << std::endl;
154  return str;
155  }
156 
157  std::ostream & operator<<( std::ostream & str, const WebpinResult & obj )
158  {
159  return obj.dumpOn(str);
160  }
161 
162 } // namespace ws
163 
165 } // namespace zypp
WebpinResult & setName(const std::string &name)
set the package name
Definition: WebpinResult.cc:71
Represents a result from http://api.opensuse-community.org/searchservice/Search web service...
Definition: WebpinResult.h:39
std::ostream & operator<<(std::ostream &str, const WebpinResult::Impl &obj)
Definition: WebpinResult.cc:57
std::string summary() const
package summary
std::string name() const
package name
Definition: WebpinResult.cc:77
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
WebpinResult & setPriority(int priority)
set the package priority
std::ostream & dumpOn(std::ostream &str) const
WebpinResult & setChecksum(const zypp::CheckSum &checksum)
set the package checksum
WebpinResult & setEdition(const zypp::Edition &name)
set the package edition
zypp::Url url
Definition: MediaCurl.cc:193
Impl * clone() const
clone for RWCOW_pointer
Definition: WebpinResult.cc:52
zypp::Edition edition() const
package edition
zypp::CheckSum checksum() const
package checksum Example: a md5sum or sha1sum
WebpinResult implementation.
Definition: WebpinResult.cc:30
WebpinResult & setSummary(const std::string &summary)
set the package summary
int priority() const
package priority
zypp::Url repositoryUrl() const
repository&#39;s url The url of the repository where this package is located
Definition: WebpinResult.cc:83
std::string distribution() const
package distribution Example: openSUSE 10.3
std::string checksum(const Pathname &file, const std::string &algorithm)
Compute a files checksum.
Definition: PathInfo.cc:980
WebpinResult & setDistribution(const std::string &distribution)
set the package distribution
Definition: WebpinResult.cc:94
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: WebpinResult.h:133
WebpinResult & setRepositoryUrl(const zypp::Url &url)
set the repository url where this package comes from
Definition: WebpinResult.cc:88
Url manipulation class.
Definition: Url.h:87
std::ostream & operator<<(std::ostream &str, const WebpinResult &obj)