1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/CpeId.cc
12 //#include "zypp/base/LogTools.h"
13 #include "zypp/base/NonCopyable.h"
15 #include "zypp/CpeId.h"
19 ///////////////////////////////////////////////////////////////////
22 ///////////////////////////////////////////////////////////////////
23 /// \class CpeId::Impl
24 /// \brief CpeId implementation.
25 ///////////////////////////////////////////////////////////////////
26 class CpeId::Impl : private base::NonCopyable
28 friend std::ostream & operator<<( std::ostream & str, const Impl & obj );
32 Impl( const std::string & cpe_r )
36 Impl( const std::string & cpe_r, NoThrowType )
41 const std::string & asString() const
44 Match match( const Impl & rhs ) const
46 return _cpe == rhs._cpe ? Match::equal : Match::undefined;
53 ///////////////////////////////////////////////////////////////////
57 ///////////////////////////////////////////////////////////////////
63 CpeId::CpeId( const std::string & cpe_r )
64 : _pimpl( new Impl( cpe_r ) )
67 CpeId::CpeId( const std::string & cpe_r, NoThrowType )
68 : _pimpl( new Impl( cpe_r, noThrow ) )
74 CpeId::operator bool() const
75 { return !_pimpl->asString().empty(); }
77 std::string CpeId::asString() const
78 { return _pimpl->asString(); }
80 CpeId::Match CpeId::match( const CpeId & rhs ) const
81 { return _pimpl->match( *rhs._pimpl ); }
84 ///////////////////////////////////////////////////////////////////