#--------------------------------------------------------------------------------
SET (have_system x)
+set (CMAKE_CXX_STANDARD 14)
+
IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
SET (ENABLE_BUILD_DOCS ON)
CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY)
CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
-SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed -Wp,-D_GLIBCXX_ASSERTIONS" )
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed -Wp,-D_GLIBCXX_ASSERTIONS" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wp,-D_GLIBCXX_ASSERTIONS" )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wp,-D_GLIBCXX_ASSERTIONS" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -Woverloaded-virtual -Wnon-virtual-dtor" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security")
ENDIF(${CXX_FORMAT_SECURITY})
+if ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ #cli args ignored by clang, it still prints a noisy warning though
+ SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -Wl,-as-needed" )
+ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic -Wl,-as-needed" )
+endif()
+
INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(pipe2 PIPE2_FOUND)
IF(${PIPE2_FOUND})
#
SET(LIBZYPP_MAJOR "17")
SET(LIBZYPP_COMPATMINOR "12")
-SET(LIBZYPP_MINOR "13")
+SET(LIBZYPP_MINOR "14")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 17.13.0 (12)
+# LAST RELEASED: 17.14.0 (12)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Mon Aug 5 13:03:55 CEST 2019 - ma@suse.de
+
+- PublicKey::algoName: supply key algorithm and length
+- version 17.14.0 (12)
+
+-------------------------------------------------------------------
Thu Jul 25 17:25:10 CEST 2019 - ma@suse.de
- MediaCurl: Fix leaking filedescriptors (bsc#1116995)
{ /////////////////////////////////////////////////////////////////
/** \relates zypp::Arch Default order for std::container based Arch::compare.*/
template<>
+#ifdef __clang__
+constexpr
+#endif
inline bool less<zypp::Arch>::operator()( const zypp::Arch & lhs, const zypp::Arch & rhs ) const
{ return lhs.compare( rhs ) < 0; }
/////////////////////////////////////////////////////////////////
base/Sysconfig.cc
base/ProfilingFormater.cc
base/LogControl.cc
+ base/Xml.cc
)
SET( zypp_base_HEADERS
/** */
template<class TReport>
- class DistributeReport;
+ struct DistributeReport;
/** */
template<class TReport>
} // namespace
///////////////////////////////////////////////////////////////////
+ constexpr CpeId::NoThrowType CpeId::noThrow;
+
///////////////////////////////////////////////////////////////////
/// \class CpeId::Impl
/// \brief CpeId implementation.
const CpeId::Value CpeId::Value::ANY;
const CpeId::Value CpeId::Value::NA( "" );
+ constexpr CpeId::Value::FsFormatType CpeId::Value::fsFormat;
+ constexpr CpeId::Value::UriFormatType CpeId::Value::uriFormat;
+
CpeId::Value::Value( const std::string & value_r )
{
if ( value_r.empty() ) // NA
public:
/** Implementation */
- class Impl;
+ struct Impl;
public:
/** Default ctor */
#include "zypp/base/Flags.h"
#include "zypp/sat/SolvAttr.h"
#include "zypp/ResObject.h"
+#include "zypp/sat/SolvableSet.h"
///////////////////////////////////////////////////////////////////
namespace zypp
#include "zypp/ResObject.h"
#include "zypp/Pathname.h"
+#include "zypp/sat/SolvableSet.h"
///////////////////////////////////////////////////////////////////
namespace zypp
public:
/** Implementation */
- class Impl;
+ struct Impl;
private:
/** Pointer to implementation */
RWCOW_pointer<Impl> _pimpl;
public:
/** Implementation. */
- class Impl;
+ struct Impl;
private:
/** Pointer to implementation. */
RW_pointer<Impl> _pimpl;
void setBuddy( const sat::Solvable & solv_r );
/** internal ctor */
public:
- class Impl; ///< Expose type only
+ struct Impl; ///< Expose type only
private:
explicit PoolItem( Impl * implptr_r );
/** Pointer to implementation */
/** \name tmp hack for save/restore state. */
/** \todo get rid of it. */
//@{
- friend class PoolItemSaver;
+ friend struct PoolItemSaver;
void saveState() const;
void restoreState() const;
bool sameState() const;
const Container & container() const;
private:
/** Implementation */
- class Impl;
+ struct Impl;
/** Pointer to implementation */
RWCOW_pointer<Impl> & pimpl() { return *(reinterpret_cast<RWCOW_pointer<Impl>*>( _dont_use_this_use_pimpl.get() )); }
/** Pointer to implementation */
private:
- class Impl;
+ struct Impl;
RWCOW_pointer<Impl> _pimpl;
};
return ret;
}
+ std::string keyAlgoName( const gpgme_subkey_t & key_r )
+ {
+ std::string ret;
+ if ( const char * n = ::gpgme_pubkey_algo_name( key_r->pubkey_algo ) )
+ ret = str::Str() << n << ' ' << key_r->length;
+ else
+ ret = "?";
+ return ret;
+ }
} //namespace
///////////////////////////////////////////////////////////////////
std::string _id;
std::string _name;
std::string _fingerprint;
+ std::string _algoName;
Date _created;
Date _expires;
data->_expires = zypp::Date(sKey->expires);
data->_fingerprint = str::asString(sKey->fpr);
+ data->_algoName = keyAlgoName( sKey );
data->_id = str::asString(sKey->keyid);
//get the primary user ID
std::string PublicKeyData::fingerprint() const
{ return _pimpl->_fingerprint; }
+ std::string PublicKeyData::algoName() const
+ { return _pimpl->_algoName; }
+
Date PublicKeyData::created() const
{ return _pimpl->_created; }
}
PublicKeyData::AsciiArt PublicKeyData::asciiArt() const
- { return AsciiArt( fingerprint() /* TODO: key algorithm could be added as top tile. */ ); }
+ { return AsciiArt( fingerprint(), algoName() ); }
std::ostream & dumpOn( std::ostream & str, const PublicKeyData & obj )
{
str << "[" << obj.name() << "]" << endl;
str << " fpr " << obj.fingerprint() << endl;
str << " id " << obj.id() << endl;
+ str << " alg " << obj.algoName() << endl;
str << " cre " << Date::ValueType(obj.created()) << ' ' << obj.created() << endl;
str << " exp " << Date::ValueType(obj.expires()) << ' ' << obj.expiresAsString() << endl;
str << " ttl " << obj.daysToLive() << endl;
std::string PublicKey::fingerprint() const
{ return keyData().fingerprint(); }
+ std::string PublicKey::algoName() const
+ { return keyData().algoName(); }
+
Date PublicKey::created() const
{ return keyData().created(); }
std::string asString() const;
private:
- class Impl;
+ struct Impl;
RWCOW_pointer<Impl> _pimpl;
friend class PublicKeyData;
friend std::ostream & dumpOn( std::ostream & str, const PublicKeyData & obj );
/** Key fingerprint.*/
std::string fingerprint() const;
+ /** Key algorithm string like `RSA 2048` */
+ std::string algoName() const;
+
/** Creation / last modification date (latest selfsig). */
Date created() const;
AsciiArt asciiArt() const;
private:
- class Impl;
+ struct Impl;
RWCOW_pointer<Impl> _pimpl;
friend class KeyManagerCtx;
{
public:
/** Implementation */
- class Impl;
+ struct Impl;
public:
/** Default ctor. */
std::string id() const; //!< \see \ref PublicKeyData
std::string name() const; //!< \see \ref PublicKeyData
std::string fingerprint() const; //!< \see \ref PublicKeyData
+ std::string algoName() const; //!< \see \ref PublicKeyData
Date created() const; //!< \see \ref PublicKeyData
Date expires() const; //!< \see \ref PublicKeyData
std::string expiresAsString() const; //!< \see \ref PublicKeyData
*/
virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const;
- class Impl;
+ struct Impl;
private:
friend class RepoManager;
/** Raw values for RepoManager */
public:
/** Implementation */
- class Impl;
+ struct Impl;
/** ServiceInfo typedefs */
typedef std::set<ServiceInfo> ServiceSet;
Date timestamp() const;
public:
- class Impl; ///< Implementation
+ struct Impl; ///< Implementation
private:
RWCOW_pointer<Impl> _pimpl; ///< Pointer to implementation
};
#include "zypp/Vendor.h"
#include "zypp/sat/LookupAttr.h"
-#include "zypp/sat/SolvableSet.h"
///////////////////////////////////////////////////////////////////
namespace zypp
public:
/** Implementation */
- class Impl;
+ struct Impl;
typedef MapKVIteratorTraits<SelectablePool>::Value_const_iterator const_iterator;
typedef SelectablePool::size_type size_type;
namespace resstatus
{
- class UserLockQueryManip;
+ struct UserLockQueryManip;
class StatusBackup;
}
/** \name Internal hard lock maintainance */
//@{
- friend class resstatus::UserLockQueryManip;
+ friend struct resstatus::UserLockQueryManip;
bool isUserLockQueryMatch() const
{ return fieldValueIs<UserLockQueryField>( USERLOCK_MATCH ); }
static bool isPseudoInstalled() { return traits::isPseudoInstalled( kind ); }
};
+ // Defined in ResKind.cc
+ template<> const ResKind ResTraits<Package>::kind;
+ template<> const ResKind ResTraits<Patch>::kind;
+ template<> const ResKind ResTraits<Pattern>::kind;
+ template<> const ResKind ResTraits<Product>::kind;
+ template<> const ResKind ResTraits<SrcPackage>::kind;
+ template<> const ResKind ResTraits<Application>::kind;
+
/** ResTraits specialisation for Resolvable.
* Resolvable is common base and has no Kind value.
*/
void addSolution( ProblemSolution_Ptr solution, bool inFront = false );
private:
- class Impl;
+ struct Impl;
RWCOW_pointer<Impl> _pimpl;
};
*/
virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const;
- class Impl;
+ struct Impl;
private:
RWCOW_pointer<Impl> _pimpl;
// _specMap[root] - scan root/zypp.conf and root/multiversion.d
if ( root_r.empty() )
- root_r == "/";
+ root_r = "/";
bool cacheHit = _specMap.count( root_r );
MultiversionSpec & ret( _specMap[root_r] ); // creates new entry on the fly
bool isProcessRunning( pid_t pid_r )
{
// it is another program, not me, see if it is still running
- Pathname procdir( "/proc"/str::numstring(pid_r) );
+ Pathname procdir( Pathname("/proc")/str::numstring(pid_r) );
PathInfo status( procdir );
MIL << "Checking " << status << endl;
{
MIL << "Waiting whether pid " << globalLock().lockerPid() << " ends within $LOCK_TIMEOUT=" << LOCK_TIMEOUT << " sec." << endl;
unsigned delay = 1;
- Pathname procdir( "/proc"/str::numstring(globalLock().lockerPid()) );
+ Pathname procdir( Pathname("/proc")/str::numstring(globalLock().lockerPid()) );
for ( long i = 0; i < LOCK_TIMEOUT; i += delay )
{
if ( PathInfo( procdir ).isDir() ) // wait for /proc/pid to disapear
{
// another proc locked faster. maybe it ends fast as well....
MIL << "Waiting whether pid " << globalLock().lockerPid() << " ends within " << (LOCK_TIMEOUT-i) << " sec." << endl;
- procdir = Pathname( "/proc"/str::numstring(globalLock().lockerPid()) );
+ procdir = Pathname( Pathname("/proc")/str::numstring(globalLock().lockerPid()) );
}
else
{
#define ZYPP_BASE_EASY_H
#include <cstdio>
+#include <type_traits>
/** Convenient for-loops using iterator.
* \code
NON_MOVABLE(CLASS); \
DEFAULT_COPYABLE(CLASS)
+
+/** Prevent an universal ctor to be chosen as copy ctor.
+ * \code
+ * struct FeedStrings
+ * {
+ * template<typename TARG, typename X = disable_use_as_copy_ctor<FeedStrings,TARG>>
+ * FeedStrings( TARG && arg_r )
+ * : _value { std::forward<TARG>( arg_r ) }
+ * {}
+ *
+ * // Same with variadic template. Could be chosen as copy_ctor.
+ * template<typename ... Us>
+ * FeedStrings( Us &&... us )
+ * : ...
+ *
+ * private:
+ * std::string _value;
+ * \endcode
+ */
+template<typename TBase, typename TDerived>
+using disable_use_as_copy_ctor = typename std::enable_if<!std::is_base_of<TBase,typename std::remove_reference<TDerived>::type>::value>::type;
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
/** Helper for \ref ZYPP_THROW( Exception ). */
template<class TExcpt, EnableIfIsException<TExcpt> = 0>
void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn));
- template<class TExcpt, EnableIfIsException<TExcpt> = 0>
+ template<class TExcpt, EnableIfIsException<TExcpt>>
void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r )
{
excpt_r.relocate( where_r );
/** Helper for \ref ZYPP_THROW( not Exception ). */
template<class TExcpt, EnableIfNotException<TExcpt> = 0>
void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn));
- template<class TExcpt, EnableIfNotException<TExcpt> = 0>
+ template<class TExcpt, EnableIfNotException<TExcpt>>
void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r )
{
Exception::log( typeid(excpt_r).name(), where_r, "THROW: " );
/** Helper for \ref ZYPP_THROW( Exception ). */
template<class TExcpt, EnableIfIsException<TExcpt> = 0>
void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn));
- template<class TExcpt, EnableIfIsException<TExcpt> = 0>
+ template<class TExcpt, EnableIfIsException<TExcpt>>
void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r )
{
Exception::log( excpt_r, where_r, "RETHROW: " );
/** Helper for \ref ZYPP_THROW( not Exception ). */
template<class TExcpt, EnableIfNotException<TExcpt> = 0>
void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn));
- template<class TExcpt, EnableIfNotException<TExcpt> = 0>
+ template<class TExcpt, EnableIfNotException<TExcpt>>
void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r )
{
Exception::log( excpt_r, where_r, "RETHROW: " );
public:
/** Implementation */
- class Impl;
+ struct Impl;
public:
/** Default ctor matches nothing. */
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/base/Xml.cc
+ *
+*/
+#include "Xml.h"
+
+namespace zypp
+{
+ namespace xmlout
+ {
+ constexpr Node::OptionalContentType Node::optionalContent;
+ }
+}
CredentialSize credsUserSize() const;
bool credsUserEmpty() const;
- class Impl;
+ struct Impl;
private:
RW_pointer<Impl> _pimpl;
};
protected:
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev );
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
virtual void getFile(const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
- virtual void forceEject(const std::string & ejectDev);
+ virtual void forceEject(const std::string & ejectDev) override;
- virtual bool hasMoreDevices();
+ virtual bool hasMoreDevices() override;
virtual void
getDetectedDevices(std::vector<std::string> & devices,
- unsigned int & index) const;
+ unsigned int & index) const override;
public:
MediaCD( const Url & url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaCD() { try { release(); } catch(...) {} }
+ virtual ~MediaCD() override { try { release(); } catch(...) {} }
- virtual bool isAttached() const;
+ virtual bool isAttached() const override;
};
///////////////////////////////////////////////////////////////////
protected:
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev );
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
public:
MediaCIFS( const Url& url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaCIFS() { try { release(); } catch(...) {} }
+ virtual ~MediaCIFS() override { try { release(); } catch(...) {} }
- virtual bool isAttached() const;
+ virtual bool isAttached() const override;
private:
bool authenticate( AuthData & authdata, bool firstTry ) const;
return false;
}
+//need a out of line definiton, otherwise vtable is emitted for every translation unit
+MediaCurl::Callbacks::~Callbacks() {}
+
} // namespace media
} // namespace zypp
Url clearQueryString(const Url &url) const;
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev );
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
/**
* Repeatedly calls doGetDoesFileExist() until it successfully returns,
* fails unexpectedly, or user cancels the operation. This is used to
* handle authentication or similar retry scenarios on media level.
*/
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
/**
* \see MediaHandler::getDoesFileExist
* \throws MediaException
*
*/
- virtual void disconnectFrom();
+ virtual void disconnectFrom() override;
/**
*
* \throws MediaException
virtual void doGetFileCopy( const Pathname & srcFilename, const Pathname & targetFilename, callback::SendReport<DownloadProgressReport> & _report, const ByteCount &expectedFileSize_r, RequestOptions options = OPTION_NONE ) const;
- virtual bool checkAttachPoint(const Pathname &apoint) const;
+ virtual bool checkAttachPoint(const Pathname &apoint) const override;
public:
MediaCurl( const Url & url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaCurl() { try { release(); } catch(...) {} }
+ virtual ~MediaCurl() override { try { release(); } catch(...) {} }
TransferSettings & settings();
class Callbacks
{
public:
- virtual ~Callbacks() {}
+ virtual ~Callbacks();
virtual bool progress( int percent ) = 0;
};
protected:
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev );
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
public:
MediaDIR( const Url & url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaDIR() { try { release(); } catch(...) {} }
+ virtual ~MediaDIR() override { try { release(); } catch(...) {} }
};
///////////////////////////////////////////////////////////////////
class MediaDISK : public MediaHandler {
private:
-
- unsigned long _mountflags;
-
std::string _device;
std::string _filesystem;
protected:
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev );
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
virtual void getFile(const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
public:
MediaDISK( const Url & url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaDISK() { try { release(); } catch(...) {} }
+ virtual ~MediaDISK() override { try { release(); } catch(...) {} }
- virtual bool isAttached() const;
+ virtual bool isAttached() const override;
bool verifyIfDiskVolume(const Pathname &name);
};
namespace media {
/////////////////////////////////////////////////////////////////
+ MediaException::~MediaException () noexcept {}
+
std::ostream & MediaMountException::dumpOn( std::ostream & str ) const
{
str << form(_("Failed to mount %s on %s"), _source.c_str(), _target.c_str() );
return str;
}
- /////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
} // namespace media
} // namespace zypp
///////////////////////////////////////////////////////////////////
{}
/** Dtor. */
- virtual ~MediaException() throw() {};
+ virtual ~MediaException() noexcept override;
};
class MediaMountException : public MediaException
, _cmdout(cmdout_r)
{}
/** Dtor. */
- virtual ~MediaMountException() throw() {};
+ virtual ~MediaMountException() noexcept {}
const std::string & mountError() const
{ return _error; }
, _path(path_r)
{}
/** Dtor. */
- virtual ~MediaUnmountException() throw() {};
+ virtual ~MediaUnmountException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _filename(filename_r)
{}
- virtual ~MediaBadFilenameException() throw() {};
+ virtual ~MediaBadFilenameException() noexcept {}
std::string filename() const { return _filename; }
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
: MediaException()
, _action(action_r)
{}
- virtual ~MediaNotOpenException() throw() {};
+ virtual ~MediaNotOpenException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _url(url_r.asString())
, _filename(filename_r.asString())
{}
- virtual ~MediaFileNotFoundException() throw() {};
+ virtual ~MediaFileNotFoundException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _filename(filename_r.asString())
{}
- virtual ~MediaWriteException() throw() {};
+ virtual ~MediaWriteException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _url(url_r.asString())
{}
- virtual ~MediaNotAttachedException() throw() {};
+ virtual ~MediaNotAttachedException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _url(url_r.asString())
{}
- virtual ~MediaBadAttachPointException() throw() {};
+ virtual ~MediaBadAttachPointException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _url(url_r.asString())
{}
- virtual ~MediaCurlInitException() throw() {};
+ virtual ~MediaCurlInitException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _url(url_r.asString())
, _message(message_r)
{}
- virtual ~MediaSystemException() throw() {};
+ virtual ~MediaSystemException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _url(url_r.asString())
, _path(path_r.asString())
{}
- virtual ~MediaNotAFileException() throw() {};
+ virtual ~MediaNotAFileException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _url(url_r.asString())
, _path(path_r.asString())
{}
- virtual ~MediaNotADirException() throw() {};
+ virtual ~MediaNotADirException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _url(url_r.asString())
, _msg(msg_r)
{}
- virtual ~MediaBadUrlException() throw() {};
+ virtual ~MediaBadUrlException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
MediaBadUrlEmptyHostException(const Url & url_r)
: MediaBadUrlException(url_r)
{}
- virtual ~MediaBadUrlEmptyHostException() throw() {};
+ virtual ~MediaBadUrlEmptyHostException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
};
MediaBadUrlEmptyFilesystemException(const Url & url_r)
: MediaBadUrlException(url_r)
{}
- virtual ~MediaBadUrlEmptyFilesystemException() throw() {};
+ virtual ~MediaBadUrlEmptyFilesystemException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
};
MediaBadUrlEmptyDestinationException(const Url & url_r)
: MediaBadUrlException(url_r)
{}
- virtual ~MediaBadUrlEmptyDestinationException() throw() {};
+ virtual ~MediaBadUrlEmptyDestinationException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
};
MediaUnsupportedUrlSchemeException(const Url & url_r)
: MediaBadUrlException(url_r)
{}
- virtual ~MediaUnsupportedUrlSchemeException() throw() {};
+ virtual ~MediaUnsupportedUrlSchemeException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
};
: MediaException()
, _url(url_r.asString())
{}
- virtual ~MediaNotSupportedException() throw() {};
+ virtual ~MediaNotSupportedException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
, _err(err_r)
, _msg(msg_r)
{}
- virtual ~MediaCurlException() throw() {};
+ virtual ~MediaCurlException() noexcept {}
std::string errstr() const { return _err; }
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
, _url(url_r.asString())
, _msg(msg_r)
{}
- virtual ~MediaCurlSetOptException() throw() {};
+ virtual ~MediaCurlSetOptException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
: MediaException()
, _url(url_r.asString())
{}
- virtual ~MediaNotDesiredException() throw() {};
+ virtual ~MediaNotDesiredException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException()
, _name(name)
{}
- virtual ~MediaIsSharedException() throw() {};
+ virtual ~MediaIsSharedException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
: MediaException("Can't eject media")
, _name(name)
{}
- virtual ~MediaNotEjectedException() throw() {};
+ virtual ~MediaNotEjectedException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
private:
, _hint(hint_r)
{}
- virtual ~MediaUnauthorizedException() throw() {};
+ virtual ~MediaUnauthorizedException() noexcept {}
const Url & url() const { return _url; }
const std::string & err() const { return _err; }
: MediaException(msg)
, _url(url_r.asString()), _msg(msg)
{}
- virtual ~MediaForbiddenException() throw() {};
+ virtual ~MediaForbiddenException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
: MediaException(msg)
, _url(url_r.asString()), _msg(msg)
{}
- virtual ~MediaTimeoutException() throw() {};
+ virtual ~MediaTimeoutException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
, _msg(msg)
, _expectedFileSize(cnt_r)
{}
- virtual ~MediaFileSizeExceededException() throw() {};
+ virtual ~MediaFileSizeExceededException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
: MediaException(msg)
, _url(url_r.asString()), _msg(msg)
{}
- virtual ~MediaTemporaryProblemException() throw() {};
+ virtual ~MediaTemporaryProblemException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
: MediaException(msg)
, _url(url_r.asString()), _msg(msg)
{}
- virtual ~MediaBadCAException() throw() {};
+ virtual ~MediaBadCAException() noexcept {}
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
std::string _url;
{
private:
Pathname _isofile;
- MediaAccessId _isosource;
std::string _filesystem;
protected:
- virtual void attachTo (bool next = false);
- virtual void releaseFrom( const std::string & ejectDev = "" );
- virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void attachTo (bool next = false) override;
+ virtual void releaseFrom( const std::string & ejectDev = "" ) override;
+ virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
public:
const Pathname &attach_point_hint_r);
virtual
- ~MediaISO();
+ ~MediaISO() override;
virtual bool
- isAttached() const;
+ isAttached() const override;
};
///////////////////////////////////////////////////////////////////
// forward declaration
- class MountEntry;
+ struct MountEntry;
class MediaManager_Impl;
///////////////////////////////////////////////////////////////////
friend class multifetchworker;
MediaMultiCurl(const Url &url_r, const Pathname & attach_point_hint_r);
- ~MediaMultiCurl();
+ ~MediaMultiCurl() override;
virtual void doGetFileCopy( const Pathname & srcFilename, const Pathname & targetFilename, callback::SendReport<DownloadProgressReport> & _report, const ByteCount &expectedFileSize_r, RequestOptions options = OPTION_NONE ) const override;
CURL *fromEasyPool(const std::string &host) const;
void toEasyPool(const std::string &host, CURL *easy) const;
- virtual void setupEasy();
+ virtual void setupEasy() override;
void checkFileDigest(Url &url, FILE *fp, MediaBlockList *blklist) const;
static int progressCallback( void *clientp, double dltotal, double dlnow, double ultotal, double ulnow );
protected:
- virtual void attachTo (bool next = false);
+ virtual void attachTo (bool next = false) override;
- virtual void releaseFrom( const std::string & ejectDev );
- virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const;
- virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
+ virtual void releaseFrom( const std::string & ejectDev ) override;
+ virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
+ virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
virtual void getDirInfo( std::list<std::string> & retlist,
- const Pathname & dirname, bool dots = true ) const;
+ const Pathname & dirname, bool dots = true ) const override;
virtual void getDirInfo( filesystem::DirContent & retlist,
- const Pathname & dirname, bool dots = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename ) const;
+ const Pathname & dirname, bool dots = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename ) const override;
public:
MediaNFS( const Url& url_r,
const Pathname & attach_point_hint_r );
- virtual ~MediaNFS() { try { release(); } catch(...) {} }
+ virtual ~MediaNFS() override { try { release(); } catch(...) {} }
- virtual bool isAttached() const;
+ virtual bool isAttached() const override;
};
///////////////////////////////////////////////////////////////////
public:
MediaPlugin( const Url & url_r, const Pathname & attach_point_hint_r );
- virtual ~MediaPlugin() { try { release(); } catch(...) {} }
+ virtual ~MediaPlugin() override { try { release(); } catch(...) {} }
protected:
- virtual void attachTo( bool next_r = false );
- virtual void releaseFrom( const std::string & ejectDev_r );
- virtual void getFile( const Pathname & filename_r, const ByteCount &expectedFileSize_r ) const;
- virtual void getDir( const Pathname & dirname_r, bool recurse_r ) const;
- virtual void getDirInfo( std::list<std::string> & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const;
- virtual void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const;
- virtual bool getDoesFileExist( const Pathname & filename_r ) const;
+ virtual void attachTo( bool next_r = false ) override;
+ virtual void releaseFrom( const std::string & ejectDev_r ) override;
+ virtual void getFile( const Pathname & filename_r, const ByteCount &expectedFileSize_r ) const override;
+ virtual void getDir( const Pathname & dirname_r, bool recurse_r ) const override;
+ virtual void getDirInfo( std::list<std::string> & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override;
+ virtual void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override;
+ virtual bool getDoesFileExist( const Pathname & filename_r ) const override;
};
//////////////////////////////////////////////////////////////////
public:
- class Impl;
+ struct Impl;
typedef std::multimap<std::string, std::string> HeaderList;
private:
/** Implementation */
- class Impl;
+ struct Impl;
RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
};
class ProductFileData
{
public:
- class Impl;
+ struct Impl;
/** Ctor takes ownership of \c allocated_r. */
ProductFileData( Impl * allocated_r = 0 );
struct Upgrade
{
public:
- class Impl;
+ struct Impl;
/** Ctor takes ownership of \c allocated_r. */
Upgrade( Impl * allocated_r = 0 );
struct ContentFileReader::Impl
{
public:
- Impl( const ContentFileReader & parent_r )
- : _parent( parent_r )
+ Impl()
{}
RepoIndex & repoindex()
std::string _inputname;
private:
- const ContentFileReader & _parent;
RepoIndex_Ptr _repoindex;
};
///////////////////////////////////////////////////////////////////
//
void ContentFileReader::beginParse()
{
- _pimpl.reset( new Impl(*this) );
+ _pimpl.reset( new Impl() );
// actually mandatory, but in case they were forgotten...
_pimpl->repoindex().descrdir = "suse/setup/descr";
_pimpl->repoindex().datadir = "suse";
const std::string & line_r = "-" ) const;
private:
- class Impl;
+ struct Impl;
RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
RepoIndexConsumer _repoIndexConsumer;
};
{ /////////////////////////////////////////////////////////////////
class Reader;
- class ParseDefConsume;
+ struct ParseDefConsume;
///////////////////////////////////////////////////////////////////
//
public:
/** Implementation */
- class Impl;
+ struct Impl;
public:
DeltaCandidates();
bool isCached() const;
public:
- class Impl; ///< Implementation class.
+ struct Impl; ///< Implementation class.
private:
RW_pointer<Impl> _pimpl; ///< Pointer to implementation.
};
*/
virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const;
- class Impl;
+ struct Impl;
private:
/** Pointer to implementation */
RWCOW_pointer<Impl> _pimpl;
~ServiceRepos();
public:
- class Impl; //!< Expose type only
+ struct Impl; //!< Expose type only
private:
RW_pointer<Impl> _impl;
};
class CheckSum;
class Match;
- class MatchException;
+ struct MatchException;
class StrMatcher;
///////////////////////////////////////////////////////////////////
namespace sat
{ /////////////////////////////////////////////////////////////////
+ constexpr Map::PoolSizeType Map::poolSize;
+
Map::Map()
: _pimpl( new detail::CMap )
{ ::map_init( _pimpl.get(), 0 ); }
#include "zypp/base/Hash.h"
#include "zypp/sat/Solvable.h"
+#include "zypp/PoolItem.h"
+#include "zypp/ui/Selectable.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- class PoolItem;
- class asPoolItem; // transform functor
-
- namespace ui
- {
- class asSelectable; // transform functor
- }
-
///////////////////////////////////////////////////////////////////
namespace sat
{ /////////////////////////////////////////////////////////////////
class Solvable;
- class asSolvable; // transform functor
+ //class asSolvable; // transform functor
namespace solvitermixin_detail
{
namespace sat
{ /////////////////////////////////////////////////////////////////
+ constexpr Transaction::LoadFromPoolType Transaction::loadFromPool;
+
/** Transaction implementation.
*
* \NOTE After commit the @System repo is reloaded. This invalidates
public:
/** Implementation */
- class Impl;
+ struct Impl;
private:
/** Pointer to implementation */
RW_pointer<Impl> _pimpl;
const_iterator end() const;
private:
- struct Impl;
+ class Impl;
RW_pointer<Impl> _pimpl;
};
///////////////////////////////////////////////////////////////////
namespace detail
{
class RepoIterator;
- class ByRepository;
+ struct ByRepository;
}
///////////////////////////////////////////////////////////////////
class Resolver;
typedef Resolver ResolverInternal; ///< Preferred name in API
- class ItemCapKind;
+ struct ItemCapKind;
typedef std::list<ItemCapKind> ItemCapKindList;
DEFINE_PTR_TYPE(SolverQueueItem);
public:
/** Implementation */
- class Impl;
+ struct Impl;
public:
typedef std::vector<std::string> ModaliasList;
public:
/** Implementation */
- class Impl;
+ struct Impl;
typedef shared_ptr<Impl> Impl_Ptr;
/** Default ctor */
Selectable( Impl_Ptr pimpl_r );
// METHOD TYPE : Constructor
//
ZYppImpl::ZYppImpl()
- : _target(0)
+ : _target( nullptr )
, _resolver( new Resolver( ResPool::instance()) )
{
ZConfig::instance().about( MIL );
if (_target)
_target->unload();
- _target = 0;
+ _target = nullptr;
}
//------------------------------------------------------------------------
Pathname myTmpDir() // from TmpPath.h
{
- static filesystem::TmpDir _tmpdir( TmpPath::defaultLocation(), "zypp." );
+ static filesystem::TmpDir _tmpdir( filesystem::TmpPath::defaultLocation(), "zypp." );
return _tmpdir.path();
}
#include "zypp/DiskUsageCounter.h"
#include "zypp/ManagedFile.h"
-using namespace zypp::filesystem;
-
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////