17#include <zypp/base/PtrTypes.h>
18#include <zypp/base/Flags.h>
19#include <zypp/base/EnumClass.h>
71 explicit CpeId(
const std::string & cpe_r );
76 explicit CpeId(
const char * cpe_r )
77 :
CpeId(
std::string( cpe_r ? cpe_r :
"" ) )
83 CpeId(
const std::string & cpe_r, NoThrowType );
90 explicit operator bool()
const;
101 std::string
asFs()
const;
108 std::string
asUri()
const;
115 std::string
asWfn()
const;
137 {
return str << CpeId::Attribute::asString( obj.asEnum() ); }
186 explicit Value(
const std::string & value_r );
191 explicit Value(
const char * value_r )
192 :
Value(
std::string( value_r ? value_r :
"*" ) )
198 Value(
const std::string & encoded_r, FsFormatType );
203 Value(
const std::string & encoded_r, UriFormatType );
215 typedef base::EnumClass<ETypeDef>
Type;
220 if ( !
_value )
return Type::ANY;
221 if (
_value->empty() )
return Type::NA;
222 return(
isWildcarded() ? Type::wildcarded : Type::wildcardfree );
238 {
return( type_r == Type::ANY || type_r == Type::NA ); }
245 {
return( type_r == Type::wildcardfree || type_r == Type::wildcarded ); }
265 std::string
asWfn()
const;
272 std::string
asFs()
const;
279 std::string
asUri()
const;
#define SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(DERIVED_TYPE, OTHER_TYPE)
Define compare between Derived and some other type (e.g.
bool isWildcardfree() const
An attribute value string without wildcards ([*?] at begin and/or end)
static const Value ANY
Logical value matching ANY value.
bool isNA() const
Whether value is NA.
static const Value NA
Logical value indicating “not applicable/not used".
bool isWildcarded() const
An attribute value string with wildcards ([*?] at begin and/or end)
RWCOW_pointer< std::string > _value
bool isLogical() const
Whether it's a logical value (ANY|NA).
base::EnumClass< ETypeDef > Type
'enum class Type'
bool isANY() const
Whether value is ANY.
Value(const char *value_r)
Ctor from char* (WFN format; nullptr or "*" represent ANY; "" represents NA)
static constexpr UriFormatType uriFormat
Indicator argument for ctor arg in URI format.
bool isLogical(Type type_r) const
static constexpr FsFormatType fsFormat
Indicator argument for ctor arg in FS format.
bool isString() const
Whether it's an attribute value string (not logical value).
std::string asString() const
Default string representation [asWfn].
Type type() const
Return the Type of this Value.
std::string asFs() const
String representation as in Formated-String (ANY:"*", NA:"-")
SetCompare setRelationMixinCompare(const Value &trg) const
CPE name matching hook for SetRelationMixin.
Value()
Default ctor: ANY.
bool containsWildcard() const
HAs unquoted [*?] at begin and/or end of value.
bool isString(Type type_r) const
std::string asUri() const
String representation as in URI (ANY:"", NA:"-")
std::string asWfn() const
String representation as in Well-Formed-Name (ANY:"*", NA:"").
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
std::string asUri() const
String representation as URI (in/out).
base::EnumClass< EAttributeDef > Attribute
'enum class Attribute'
std::ostream & operator<<(std::ostream &str, const CpeId &obj)
Stream output.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
std::string asWfn() const
String representation as Well-Formed-Name (internal format, out only).
std::string asFs() const
String representation as Formated-String (in/out).
std::string asString() const
Default string representation [asFS].
CpeId(const char *cpe_r)
Ctor parsing from string representation (empty or URI or FS)
SetCompare setRelationMixinCompare(const CpeId &trg) const
CPE name matching hook for SetRelationMixin.
CpeId()
Default ctor: ANY-Cpeid, all attribute values are ANY.
RWCOW_pointer< Impl > _pimpl
Implementation class.
Provide set relation methods based on Derived::setRelationMixinCompare A class using this mixin must ...
SetCompare compare(const Derived &trg) const
Compare sets.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
WFN attributes (use like 'enum class Attribute')
static constexpr unsigned numAttributes
number of attributes
Indicator type for non-trowing ctor.
static std::string lastMalformed
Classification of Value types mostly for match (use like 'enum class Type')
RW_pointer supporting 'copy on write' functionality.