libzypp  17.28.0
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 <zypp/OnMediaLocation.h>
23 #include <zypp/ProvideFilePolicy.h>
24 
26 namespace zypp
27 {
28  namespace repo
30  {
31 
33  //
34  // provideFile
35  //
37 
46  ManagedFile provideFile( RepoInfo repo_r,
47  const OnMediaLocation & loc_r,
48  const ProvideFilePolicy & policy_r = ProvideFilePolicy() );
49 
61  {
62  public:
64  RepoMediaAccess( const ProvideFilePolicy & defaultPolicy_r = ProvideFilePolicy() );
66 
77  const OnMediaLocation & loc_r,
78  const ProvideFilePolicy & policy_r );
79 
82  { return provideFile( repo_r, loc_r, defaultPolicy() ); }
83 
84  public:
86  void setDefaultPolicy( const ProvideFilePolicy & policy_r );
87 
89  const ProvideFilePolicy & defaultPolicy() const;
90 
91  private:
92  class Impl;
94  };
95 
97  } // namespace repo
100 } // namespace zypp
102 #endif // ZYPP_REPO_REPOPROVIDEFILE_H
zypp::repo::RepoMediaAccess::~RepoMediaAccess
~RepoMediaAccess()
Definition: RepoProvideFile.cc:226
zypp::RepoInfo
What is known about a repository.
Definition: RepoInfo.h:72
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::OnMediaLocation
Describes a resource file located on a medium.
Definition: OnMediaLocation.h:39
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:112
ProvideFilePolicy.h
OnMediaLocation.h
zypp::RW_pointer< Impl >
RepoInfo.h
zypp::repo::RepoMediaAccess::setDefaultPolicy
void setDefaultPolicy(const ProvideFilePolicy &policy_r)
Set a new default ProvideFilePolicy.
Definition: RepoProvideFile.cc:229
zypp::ProvideFilePolicy
Policy for provideFile and RepoMediaAccess.
Definition: ProvideFilePolicy.h:30
zypp::repo::RepoMediaAccess::RepoMediaAccess
RepoMediaAccess(const ProvideFilePolicy &defaultPolicy_r=ProvideFilePolicy())
Ctor taking the default ProvideFilePolicy.
Definition: RepoProvideFile.cc:222
Functional.h
zypp::repo::RepoMediaAccess::_impl
RW_pointer< Impl > _impl
Definition: RepoProvideFile.h:92
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::repo::RepoMediaAccess::provideFile
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
Definition: RepoProvideFile.cc:235
zypp::repo::RepoMediaAccess::provideFile
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r)
Definition: RepoProvideFile.h:81
Impl
zypp::repo::RepoMediaAccess
Provides files from different repos.
Definition: RepoProvideFile.h:61
zypp::AutoDispose
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition: AutoDispose.h:93
zypp::repo::RepoMediaAccess::defaultPolicy
const ProvideFilePolicy & defaultPolicy() const
Get the current default ProvideFilePolicy.
Definition: RepoProvideFile.cc:232