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;
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;
303 #endif // ZYPP_CPEID_H
Value()
Default ctor: ANY.
RWCOW_pointer< Impl > _pimpl
Implementation class.
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
SetCompare setRelationMixinCompare(const CpeId &trg) const
CPE name matching hook for SetRelationMixin.
std::ostream & operator<<(std::ostream &str, const CpeId &obj)
Indicator type for non-trowing ctor.
WFN attributes (use like 'enum class Attribute')
CpeId(const char *cpe_r)
Ctor parsing from string representation (empty or URI or FS)
std::string asFs() const
String representation as in Formated-String (ANY:"*", NA:"-")
static constexpr unsigned numAttributes
number of attributes
std::string asUri() const
String representation as in URI (ANY:"", NA:"-")
static constexpr FsFormatType fsFormat
Indicator argument for ctor arg in FS format.
static const Value NA
Logical value indicating “not applicable/not used".
bool isString(Type type_r) const
RWCOW_pointer< std::string > _value
Type type() const
Return the Type of this Value.
String related utilities and Regular expression matching.
bool isLogical() const
Whether it's a logical value (ANY|NA).
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...
bool isANY() const
Whether value is ANY.
static std::string lastMalformed
bool isNA() const
Whether value is NA.
CpeId()
Default ctor: ANY-Cpeid, all attribute values are ANY.
static const Value ANY
Logical value matching ANY value.
bool isLogical(Type type_r) const
bool isString() const
Whether it's an attribute value string (not logical value).
std::ostream & operator<<(std::ostream &str, const Exception &obj)
base::EnumClass< ETypeDef > Type
'enum class Type'
base::EnumClass< EAttributeDef > Attribute
'enum class Attribute'
Classification of Value types mostly for match (use like 'enum class Type')
std::string asString() const
Default string representation [asWfn].
std::string asString() const
Default string representation [asFS].
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
SetCompare compare(const Derived &trg) const
Compare sets.
bool containsWildcard() const
HAs unquoted [*?] at begin and/or end of value.
bool isWildcardfree() const
An attribute value string without wildcards ([*?] at begin and/or end)
std::string asWfn() const
String representation as in Well-Formed-Name (ANY:"*", NA:"").
SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(CpeId, const char *)
SetCompare setRelationMixinCompare(const Value &trg) const
CPE name matching hook for SetRelationMixin.
std::string asUri() const
String representation as URI (in/out).
Provide set relation methods based on Derived::setRelationMixinCompare A class using this mixin must ...
static constexpr UriFormatType uriFormat
Indicator argument for ctor arg in URI format.
std::string asWfn() const
String representation as Well-Formed-Name (internal format, out only).
Easy-to use interface to the ZYPP dependency resolver.
bool isWildcarded() const
An attribute value string with wildcards ([*?] at begin and/or end)
std::string asFs() const
String representation as Formated-String (in/out).
static const std::string & asString(Enum val_r)
string representantion