libzypp  17.32.5
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/base/PtrTypes.h>
18 #include <zypp/base/Function.h>
19 #include <zypp/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 
27 namespace zypp
28 {
29  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 
62  {
63  public:
67 
77  ManagedFile provideFile( const RepoInfo& repo_r,
78  const OnMediaLocation & loc_r,
79  const ProvideFilePolicy & policy_r );
80 
83  { return provideFile( std::move(repo_r), loc_r, defaultPolicy() ); }
84 
85  public:
87  void setDefaultPolicy( const ProvideFilePolicy & policy_r );
88 
90  const ProvideFilePolicy & defaultPolicy() const;
91 
92  private:
93  class Impl;
95  };
96 
98  } // namespace repo
101 } // namespace zypp
103 #endif // ZYPP_REPO_REPOPROVIDEFILE_H
const ProvideFilePolicy & defaultPolicy() const
Get the current default ProvideFilePolicy.
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r)
Describes a resource file located on a medium.
What is known about a repository.
Definition: RepoInfo.h:71
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition: ManagedFile.h:27
Policy for provideFile and RepoMediaAccess.
RepoMediaAccess(ProvideFilePolicy defaultPolicy_r=ProvideFilePolicy())
Ctor taking the default ProvideFilePolicy.
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
Provides files from different repos.
ManagedFile provideFile(const RepoInfo &repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
RW_pointer< Impl > _impl
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
void setDefaultPolicy(const ProvideFilePolicy &policy_r)
Set a new default ProvideFilePolicy.