12#ifndef ZYPP_REPOMANAGER_H
13#define ZYPP_REPOMANAGER_H
32#include <zypp-core/ui/ProgressData>
84 RefreshIfNeededIgnoreDelay
96 RefreshService_restoreStatus = (1<<0),
97 RefreshService_forceRefresh = (1<<1),
112 bool repoEmpty()
const;
120 {
return std::list<RepoInfo>(repoBegin(),repoEnd()); }
123 RepoInfo getRepo(
const std::string & alias )
const;
126 {
return getRepo( info_r.
alias() ); }
129 bool hasRepo(
const std::string & alias )
const;
132 {
return hasRepo( info_r.
alias() ); }
137 static std::string makeStupidAlias(
const Url & url_r =
Url() );
208 RefreshCheckStatus checkIfToRefreshMetadata(
const RepoInfo &info,
210 RawMetadataRefreshPolicy policy = RefreshIfNeeded);
252 void refreshMetadata(
const RepoInfo &info,
253 RawMetadataRefreshPolicy policy = RefreshIfNeeded,
264 void cleanMetadata(
const RepoInfo &info,
275 void cleanPackages(
const RepoInfo &info,
301 void buildCache(
const RepoInfo &info,
302 CacheBuildPolicy policy = BuildIfNeeded,
317 void cleanCache(
const RepoInfo &info,
325 bool isCached(
const RepoInfo &info )
const;
337 void loadFromCache(
const RepoInfo &info,
377 void addRepository(
const RepoInfo &info,
392 void addRepositories(
const Url &url,
399 void removeRepository(
const RepoInfo & info,
411 void modifyRepository(
const std::string &alias,
417 { modifyRepository( newinfo.
alias(), newinfo, progressrcv ); }
432 RepoInfo getRepositoryInfo(
const std::string &alias,
471 bool serviceEmpty()
const;
478 ServiceSizeType serviceSize()
const;
485 ServiceConstIterator serviceBegin()
const;
491 ServiceConstIterator serviceEnd()
const;
498 {
return std::list<ServiceInfo>(serviceBegin(),serviceEnd()); }
506 ServiceInfo getService(
const std::string & alias )
const;
509 bool hasService(
const std::string & alias )
const;
525 void addService(
const std::string & alias,
const Url& url );
544 void removeService(
const std::string & alias );
554 void refreshServices(
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
564 void refreshService(
const std::string & alias,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
566 void refreshService(
const ServiceInfo & service,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
584 void modifyService(
const std::string & oldAlias,
const ServiceInfo & service );
587 { modifyService( service.
alias(), service ); }
604 {
return info.
service() == alias; }
643 template<
typename OutputIterator>
645 OutputIterator out )
const
649 std::copy( boost::make_filter_iterator( filter, repoBegin(), repoEnd() ),
650 boost::make_filter_iterator( filter, repoEnd(), repoEnd() ),
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
What is known about a repository.
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
creates and provides information about known sources.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
@ REFRESH_NEEDED
refresh is needed
@ REPO_UP_TO_DATE
repository not changed
RepoInfo getRepo(const RepoInfo &info_r) const
ServiceSet::const_iterator ServiceConstIterator
bool hasRepo(const RepoInfo &info_r) const
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
std::list< ServiceInfo > knownServices() const
List of known services.
RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
ServiceSet::size_type ServiceSizeType
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
RefreshServiceBit
Flags for tuning RefreshService.
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
void modifyService(const ServiceInfo &service)
Iterable< ServiceConstIterator > services() const
Iterate the known services.
void modifyRepository(const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
ZYPP_DECLARE_FLAGS(RefreshServiceFlags, RefreshServiceBit)
RepoSet::size_type RepoSizeType
std::list< RepoInfo > knownRepositories() const
List of known repositories.
RepoConstIterator repoBegin() const
std::set< RepoInfo > RepoSet
RepoInfo typedefs.
Iterable< RepoConstIterator > repos() const
Iterate the known repositories.
void getRepositoriesInService(const std::string &alias, OutputIterator out) const
fill to output iterator repositories in service name.
RepoConstIterator repoEnd() const
RepoSet::const_iterator RepoConstIterator
std::set< ServiceInfo > ServiceSet
ServiceInfo typedefs.
Track changing files or directories.
std::string alias() const
unique identifier for this source.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::list< RepoInfo > readRepoFile(const Url &repo_file)
Parses repo_file and returns a list of RepoInfo objects corresponding to repositories found within th...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
RW_pointer supporting 'copy on write' functionality.
RepoManager implementation.
Functor thats filter RepoInfo by service which it belongs to.
MatchServiceAlias(std::string alias_)
bool operator()(const RepoInfo &info) const
Repository type enumeration.
Service type enumeration.
Url::asString() view options.
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)