14#include <zypp/ng/Context>
20#include <zypp-core/zyppng/pipelines/Algorithm>
22#include <zypp-media/ng/Provide>
23#include <zypp-media/ng/ProvideSpec>
27 template<
typename ZyppContextRefType>
30 , _destDir(
std::move(destDir) )
34 template<
typename ZyppContextRefType>
41 template<
typename ZyppContextRefType>
47 template<
typename ZyppContextRefType>
50 _cacheDirs.push_back (
p );
53 template<
typename ZyppContextRefType>
78 template <
class Executor,
class OpType>
86 using ProvideType =
typename ContextType::ProvideType;
87 using MediaHandle =
typename ProvideType::MediaHandle;
102 MIL <<
"Didn't find " <<
_file <<
" in the caches, providing from medium" << std::endl;
105 std::shared_ptr<ProvideType> provider =
_ctx->zyppContext()->provider();
113 |
and_then( ProvideType::copyResultToDest(
_ctx->zyppContext()->provider(),
_ctx->destDir() /
_file ) )
115 file.resetDispose ();
116 return make_expected_success (std::move(file));
123 if ( cachedFile == _ctx->destDir() / _file ) {
124 cachedFile.resetDispose();
125 return makeReadyResult( expected<zypp::ManagedFile>::success(std::move(cachedFile) ));
151 std::vector<zypp::Pathname>
caches;
161 auto provider =
_ctx->zyppContext()->provider();
200 CacheProviderContextRefType
_ctx;
207 namespace DownloadWorkflow {
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void resetDispose()
Set no dispose function.
void setDispose(const Dispose &dispose_r)
Set a new dispose function.
Base class for Exception.
Wrapper class for stat/lstat.
ZyppContextRefType ContextRefType
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
ProvideFileSpec _filespec
CacheProviderContextRefType _ctx
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
typename conditional< B, T, F >::type conditional_t
String related utilities and Regular expression matching.
int unlink(const Pathname &path)
Like 'unlink'.
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
Easy-to use interface to the ZYPP dependency resolver.
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
AsyncOpRef< expected< zypp::ManagedFile > > provideToCacheDir(AsyncCacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec)
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
typename remove_smart_ptr< T >::type remove_smart_ptr_t
ResultType and_then(const expected< T, E > &exp, Function &&f)
auto firstOf(Transformation &&transformFunc, DefaultType &&def, Predicate &&predicate=detail::ContinueUntilValidPredicate())
ZyppContextRefType _zyppContext
#define ZYPP_PRIVATE_CONSTR_ARG