libzypp  17.38.7
downloadwf.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 #ifndef ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
10 #define ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
11 
12 #include <zypp-core/ng/async/task.h>
13 #include <zypp-core/ng/base/base.h>
14 #include <zypp-core/ng/pipelines/Expected>
15 #include <zypp-core/ManagedFile.h>
16 
17 namespace zyppng {
18 
21  ZYPP_FWD_DECL_TYPE_WITH_REFS (ProgressObserver);
22  ZYPP_FWD_DECL_TYPE_WITH_REFS (CacheProviderContext);
23 
24  class ProvideMediaHandle;
25  class ProvideFileSpec;
26 
27  class CacheProviderContext : public Base
28  {
29  protected:
31  public:
32 
34 
35  const ContextRef &zyppContext() const;
36  const zypp::Pathname &destDir() const;
37 
38  void addCacheDir( const zypp::Pathname &p );
39  const std::vector<zypp::Pathname> &cacheDirs() const;
40 
41 
42  protected:
43  ContextRef _zyppContext;
45  std::vector<zypp::Pathname> _cacheDirs;
46  };
47 
48  namespace DownloadWorkflow {
49  MaybeAwaitable<expected<zypp::ManagedFile>> provideToCacheDir( CacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec );
50  }
51 
52 }
53 
54 
55 #endif // ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
std::vector< zypp::Pathname > _cacheDirs
Definition: downloadwf.h:45
void addCacheDir(const zypp::Pathname &p)
Definition: downloadwf.cc:44
MaybeAwaitable< expected< zypp::ManagedFile > > provideToCacheDir(CacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec)
Definition: downloadwf.cc:192
ZYPP_DECL_PRIVATE_CONSTR_ARGS(CacheProviderContext, ContextRef zyppContext, zypp::Pathname destDir)
ZYPP_FWD_DECL_TYPE_WITH_REFS(EventDispatcher)
const zypp::Pathname & destDir() const
Definition: downloadwf.cc:38
const std::vector< zypp::Pathname > & cacheDirs() const
Definition: downloadwf.cc:50
const ContextRef & zyppContext() const
Definition: downloadwf.cc:31