12#include <zypp-media/ng/ProvideSpec>
27 const std::optional<zypp::Pathname> &
rootPath()
const;
28 MediaSyncFacadeRef
parent()
const;
37 void unref_to(
unsigned int)
const override;
51 , _attachedUrl(
std::move( baseUrl ))
85 if ( !zypp::indeterminate (check) )
89 return ( std::find( urls.begin(), urls.end(),
_attachedUrl ) != urls.end() );
97 _parent->releaseMedium (
this );
111 return _data->parent();
116 return _data.get() !=
nullptr;
132 return _data->rootPath();
141 : _res(
std::move(file) )
142 , _provideHandle(
std::move (
hdl) )
158 return medium->isSameMedium( useableUrls, request );
167 std::exception_ptr lastError;
169 std::optional<zypp::media::MediaAccessId>
attachId;
173 if ( !
request.mediaFile().empty() ) {
186 lastError = std::current_exception();
190 lastError = std::current_exception();
213 WAR <<
"Releasing zyppng::MediaSyncFacade with still valid MediaHandles, this is a bug!" << std::endl;
229 std::optional<expected<MediaSyncFacade::Res>>
lastErr;
270 if (
request.checkExistsOnly() ) {
348 mgr.close (
ptr->mediaId() );
356 ERR <<
"Releasing unknown medium " <<
ptr->mediaId () <<
" should not happen";
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void reset()
Reset to default Ctor values.
void setDispose(const Dispose &dispose_r)
Set a new dispose function.
Base class for Exception.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
Base class for reference counted objects.
Wrapper class for stat/lstat.
const std::string & asString() const
String representation.
static expected success(ConsParams &&...params)
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
std::string checksum(const Pathname &file, const std::string &algorithm)
Compute a files checksum.
int unlink(const Pathname &path)
Like 'unlink'.
int hardlinkCopy(const Pathname &oldpath, const Pathname &newpath)
Create newpath as hardlink or copy of oldpath.
ResultType and_then(const expected< T, E > &exp, Function &&f)
Wrapper for const correct access via Smart pointer types.
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
#define IMPL_PTR_TYPE(NAME)
#define ZYPP_IMPL_PRIVATE_CONSTR(Class)