libzypp: zypp/repo/RepoProvideFile.h Source File

libzypp 17.38.14

RepoProvideFile.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_REPO_REPOPROVIDEFILE_H
13#define ZYPP_REPO_REPOPROVIDEFILE_H
14
15#include <iosfwd>
16
17#include <zypp-core/base/PtrTypes.h>
18#include <zypp-core/base/Function.h>
19#include <zypp-core/base/Functional.h>
20#include <zypp/RepoInfo.h>
21#include <zypp/ManagedFile.h>
22#include <utility>
23#include <zypp-core/OnMediaLocation>
24#include <zypp/ProvideFilePolicy.h>
25
27namespace zypp
28{
30 namespace repo
31 {
32
34 //
35 // provideFile
36 //
38
47 ManagedFile provideFile( RepoInfo repo_r,
48 const OnMediaLocation & loc_r,
49 const ProvideFilePolicy & policy_r = ProvideFilePolicy() );
50
60 std::vector<Pathname> repositoryCachePaths( RepoInfo repo_r );
61
72 class ZYPP_API RepoMediaAccess
73 {
74 public:
76 RepoMediaAccess(ProvideFilePolicy defaultPolicy_r = ProvideFilePolicy() );
77 ~RepoMediaAccess();
78
88 ManagedFile provideFile( const RepoInfo& repo_r,
89 const OnMediaLocation & loc_r,
90 const ProvideFilePolicy & policy_r );
91
93 ManagedFile provideFile( RepoInfo repo_r, const OnMediaLocation & loc_r )
94 { return provideFile( std::move(repo_r), loc_r, defaultPolicy() ); }
95
96 public:
98 void setDefaultPolicy( const ProvideFilePolicy & policy_r );
99
101 const ProvideFilePolicy & defaultPolicy() const;
102
103 public:
123 static Pathname mapToCachePath( const RepoInfo & repo_r, const OnMediaLocation & resource_r );
124
125 private:
126 class Impl;
127 RW_pointer<Impl> _impl;
128 };
129
131 } // namespace repo
134} // namespace zypp
136#endif // ZYPP_REPO_REPOPROVIDEFILE_H
Function.h
Functional.h
ProvideFilePolicy.h
PtrTypes.h
RepoInfo.h
Impl
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition onmedialocation.h:37
zypp::ProvideFilePolicy
Policy for provideFile and RepoMediaAccess.
Definition ProvideFilePolicy.h:31
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::repo::RepoMediaAccess::_impl
RW_pointer< Impl > _impl
Definition RepoProvideFile.h:127
zypp::repo::RepoMediaAccess::provideFile
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r)
Definition RepoProvideFile.h:93
zypp::repo::RepoMediaAccess::RepoMediaAccess
RepoMediaAccess(ProvideFilePolicy defaultPolicy_r=ProvideFilePolicy())
Ctor taking the default ProvideFilePolicy.
Definition RepoProvideFile.cc:253
zypp::repo::RepoMediaAccess::defaultPolicy
const ProvideFilePolicy & defaultPolicy() const
Get the current default ProvideFilePolicy.
Definition RepoProvideFile.cc:263
zypp::repo::RepoMediaAccess::provideFile
ManagedFile provideFile(const RepoInfo &repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
Definition RepoProvideFile.cc:266
zypp::repo
Definition DeltaCandidates.cc:30
zypp::repo::provideFile
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
Definition RepoProvideFile.cc:121
zypp::repo::repositoryCachePaths
std::vector< Pathname > repositoryCachePaths(RepoInfo repo_r)
returns a set of paths.
Definition RepoProvideFile.cc:129
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ManagedFile
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
ManagedFile.h