1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Source.cc
16 #include "zypp/Source.h"
17 #include "zypp/source/SourceImpl.h"
18 #include "zypp/SourceFactory.h"
22 ///////////////////////////////////////////////////////////////////
24 { /////////////////////////////////////////////////////////////////
26 const Source_Ref Source_Ref::noSource;
28 ///////////////////////////////////////////////////////////////////
30 // METHOD NAME : Source_Ref::Source_Ref
33 Source_Ref::Source_Ref()
34 : _pimpl( Impl::nullimpl() )
37 ///////////////////////////////////////////////////////////////////
39 // METHOD NAME : Source_Ref::Source_Ref
42 Source_Ref::Source_Ref( const Impl_Ptr & impl_r )
48 ///////////////////////////////////////////////////////////////////
50 // Forward to SourceImpl:
52 ///////////////////////////////////////////////////////////////////
54 Source_Ref::NumericId Source_Ref::numericId() const
55 { return _pimpl->numericId(); }
57 bool Source_Ref::resStoreInitialized() const
58 { return _pimpl->resStoreInitialized(); }
60 const ResStore & Source_Ref::resolvables() const
61 { return _pimpl->resolvables(); }
63 const ResStore Source_Ref::resolvables(zypp::Resolvable::Kind kind) const
64 { return _pimpl->resolvables(kind); }
66 const Pathname Source_Ref::provideFile(const Pathname & file_r,
67 const unsigned media_nr)
68 { return _pimpl->provideFile(file_r, media_nr); }
70 const Pathname Source_Ref::provideDirTree(const Pathname & dir_r,
71 const unsigned media_nr)
72 { return _pimpl->provideDirTree(dir_r, media_nr); }
74 const Pathname Source_Ref::providePackage( Package::constPtr package )
75 { return _pimpl->providePackage( package ); }
77 const void Source_Ref::releaseFile(const Pathname & file_r,
78 const unsigned media_nr)
79 { _pimpl->releaseFile(file_r, media_nr); }
81 const void Source_Ref::releaseDir(const Pathname & dir_r,
82 const unsigned media_nr,
84 { _pimpl->releaseDir(dir_r, media_nr, recursive); }
86 bool Source_Ref::enabled() const
87 { return _pimpl->enabled(); }
89 void Source_Ref::enable()
92 void Source_Ref::disable()
93 { _pimpl->disable(); }
95 Date Source_Ref::timestamp() const
96 { return _pimpl->timestamp(); }
98 std::string Source_Ref::checksum() const
99 { return _pimpl->checksum(); }
101 bool Source_Ref::autorefresh() const
102 { return _pimpl->autorefresh(); }
104 void Source_Ref::setAutorefresh( bool enable_r )
105 { _pimpl->setAutorefresh( enable_r ); }
107 void Source_Ref::refresh()
108 { _pimpl->refresh() ; }
110 void Source_Ref::storeMetadata(const Pathname & cache_dir_r)
111 { _pimpl->storeMetadata(cache_dir_r); }
113 string Source_Ref::alias (void) const
114 { return _pimpl->alias(); }
116 void Source_Ref::setAlias (const std::string & alias_r)
117 { _pimpl->setAlias( alias_r ); }
119 string Source_Ref::type (void) const
120 { return _pimpl->type(); }
122 string Source_Ref::id (void) const
123 { return _pimpl->id(); }
125 void Source_Ref::setId (const std::string id_r)
126 { return _pimpl->setId (id_r); }
128 string Source_Ref::zmdName (void) const
129 { return _pimpl->zmdName(); }
131 void Source_Ref::setZmdName (const std::string name_r)
132 { return _pimpl->setZmdName( name_r ); }
134 string Source_Ref::zmdDescription (void) const
135 { return _pimpl->zmdDescription(); }
137 void Source_Ref::setZmdDescription (const std::string desc_r)
138 { return _pimpl->setZmdDescription( desc_r ); }
140 unsigned Source_Ref::priority (void) const
141 { return _pimpl->priority(); }
143 void Source_Ref::setPriority (unsigned p)
144 { return _pimpl->setPriority(p); }
146 unsigned Source_Ref::priorityUnsubscribed (void) const
147 { return _pimpl->priorityUnsubscribed(); }
149 void Source_Ref::setPriorityUnsubscribed (unsigned p)
150 { return _pimpl->setPriorityUnsubscribed( p ); }
152 bool Source_Ref::subscribed(void) const
153 { return _pimpl->subscribed(); }
155 void Source_Ref::setSubscribed (bool s)
156 { return _pimpl->setSubscribed( s ); }
158 Url Source_Ref::url (void) const
159 { return _pimpl->url (); }
161 void Source_Ref::setUrl( const Url & url )
162 { _pimpl->setUrl( url ); }
164 bool Source_Ref::remote (void) const
165 { return _pimpl->remote (); }
167 const Pathname & Source_Ref::path (void) const
168 { return _pimpl->path (); }
170 bool Source_Ref::baseSource() const
171 { return _pimpl->baseSource(); }
173 const Pathname & Source_Ref::cacheDir (void) const
174 { return _pimpl->cacheDir (); }
176 void Source_Ref::changeMedia(const media::MediaId & media_r, const Pathname & path_r)
177 { _pimpl->changeMedia(media_r, path_r); }
179 void Source_Ref::redirect(unsigned media_nr, const Url & new_url)
180 { _pimpl->redirect(media_nr, new_url); }
182 void Source_Ref::release()
183 { _pimpl->release(); }
185 void Source_Ref::reattach(const Pathname &attach_point)
186 { _pimpl->reattach(attach_point); }
188 media::MediaVerifierRef Source_Ref::verifier(unsigned media_nr)
189 { return _pimpl->verifier(media_nr); }
191 unsigned Source_Ref::numberOfMedia(void) const
192 { return _pimpl->numberOfMedia(); }
194 std::string Source_Ref::vendor (void) const
195 { return _pimpl->vendor(); }
197 const std::list<Pathname> Source_Ref::publicKeys()
198 { return _pimpl->publicKeys(); }
200 std::string Source_Ref::unique_id (void) const
201 { return _pimpl->unique_id(); }
203 bool Source_Ref::hasResolvablesOfKind( const zypp::Resolvable::Kind &kind ) const
204 { return _pimpl->resolvableKinds().count(kind) != 0; }
206 std::set<zypp::Resolvable::Kind> Source_Ref::resolvableKinds() const
207 { return _pimpl->resolvableKinds(); }
209 /******************************************************************
211 ** FUNCTION NAME : operator<<
212 ** FUNCTION TYPE : std::ostream &
214 std::ostream & operator<<( std::ostream & str, const Source_Ref & obj )
216 return str << *obj._pimpl;
219 /////////////////////////////////////////////////////////////////
221 ///////////////////////////////////////////////////////////////////