71 explicit CpeId(
const std::string & cpe_r );
76 explicit CpeId(
const char * cpe_r )
77 :
CpeId(
std::string( cpe_r ? cpe_r :
"" ) )
90 explicit operator bool()
const;
101 std::string
asFs()
const;
108 std::string
asUri()
const;
115 std::string
asWfn()
const;
186 explicit Value(
const std::string & value_r );
191 explicit Value(
const char * value_r )
192 :
Value(
std::string( value_r ? value_r :
"*" ) )
215 typedef base::EnumClass<_TypeDef>
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 ); }
249 {
return isString() && ! containsWildcard(); }
253 {
return isString() && containsWildcard(); }
265 std::string
asWfn()
const;
272 std::string
asFs()
const;
279 std::string
asUri()
const;
289 bool containsWildcard()
const;
303 #endif // ZYPP_CPEID_H Value()
Default ctor: ANY.
RWCOW_pointer< Impl > _pimpl
Implementation class.
std::ostream & operator<<(std::ostream &str, const CpeId &obj)
Indicator type for non-trowing ctor.
CpeId(const char *cpe_r)
Ctor parsing from string representation (empty or URI or FS)
static const Value NA
Logical value indicating “not applicable/not used".
RWCOW_pointer< std::string > _value
String related utilities and Regular expression matching.
Value(const char *value_r)
Ctor from char* (WFN format; nullptr or "*" represent ANY; "" represents NA)
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
static std::string lastMalformed
bool isString(Type type_r) const
CpeId()
Default ctor: ANY-Cpeid, all attribute values are ANY.
bool isString() const
Whether it's an attribute value string (not logical value).
static const Value ANY
Logical value matching ANY value.
static constexpr unsigned numAttributes
number of attributes
bool isLogical(Type type_r) const
Type type() const
Return the Type of this Value.
bool isNA() const
Whether value is NA.
std::string asFs() const
String representation as Formated-String (in/out).
base::EnumClass< _AttributeDef > Attribute
'enum class Attribute'
std::string asString() const
Default string representation [asFS].
SetCompare compare(const Derived &trg) const
Compare sets.
std::string asString() const
Default string representation [asWfn].
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
base::EnumClass< _TypeDef > Type
'enum class Type'
bool isWildcardfree() const
An attribute value string without wildcards ([*?] at begin and/or end)
SetCompare setRelationMixinCompare(const CpeId &trg) const
CPE name matching hook for SetRelationMixin.
SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(CpeId, const char *)
Classification of Value types mostly for match (use like 'enum class Type')
static const std::string & asString(Enum val_r)
string representantion
Easy-to use interface to the ZYPP dependency resolver.
std::string asString(const std::string &t)
Global asString() that works with std::string too.
std::string asWfn() const
String representation as Well-Formed-Name (internal format, out only).
bool isANY() const
Whether value is ANY.
std::string asUri() const
String representation as URI (in/out).
bool isWildcarded() const
An attribute value string with wildcards ([*?] at begin and/or end)
bool isLogical() const
Whether it's a logical value (ANY|NA).
WFN attributes (use like 'enum class Attribute')