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)
std::ostream & operator<<(std::ostream &str, const CpeId &obj)
Indicator type for non-trowing ctor.
WFN attributes (use like 'enum class Attribute')
bool containsWildcard() const
HAs unquoted [*?] at begin and/or end of value.
CpeId(const char *cpe_r)
Ctor parsing from string representation (empty or URI or FS)
static constexpr unsigned numAttributes
number of attributes
static constexpr FsFormatType fsFormat
Indicator argument for ctor arg in FS format.
static const Value NA
Logical value indicating “not applicable/not used".
RWCOW_pointer< std::string > _value
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...
std::string asFs() const
String representation as in Formated-String (ANY:"*", NA:"-")
std::string asWfn() const
String representation as in Well-Formed-Name (ANY:"*", NA:"").
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.
bool isLogical(Type type_r) const
Type type() const
Return the Type of this Value.
bool isNA() const
Whether value is NA.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
std::string asFs() const
String representation as Formated-String (in/out).
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 [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.
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.
SetCompare setRelationMixinCompare(const Value &trg) const
CPE name matching hook for SetRelationMixin.
SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(CpeId, const char *)
Provide set relation methods based on Derived::setRelationMixinCompare A class using this mixin must ...
std::string asUri() const
String representation as in URI (ANY:"", NA:"-")
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).
bool isANY() const
Whether value is ANY.
static const std::string & asString(Enum val_r)
string representantion
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).