libzypp  13.10.6
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
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r)
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
Describes a path on a certain media amongs as the information required to download it...
What is known about a repository.
Definition: RepoInfo.h:66
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.
ManagedFile provideFile(RepoInfo repo_r, const OnMediaLocation &loc_r, const ProvideFilePolicy &policy_r)
Provide a file from a Repository.
RepoMediaAccess(const ProvideFilePolicy &defaultPolicy_r=ProvideFilePolicy())
Ctor taking the default ProvideFilePolicy.
Provides files from different repos.
RW_pointer< Impl > _impl
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:265
Reference counted access to a _Tp object calling a custom Dispose function when the last AutoDispose ...
Definition: AutoDispose.h:92
const ProvideFilePolicy & defaultPolicy() const
Get the current default ProvideFilePolicy.
void setDefaultPolicy(const ProvideFilePolicy &policy_r)
Set a new default ProvideFilePolicy.