#include <KindOf.h>
Public Member Functions | |
| KindOf () | |
| DefaultCtor: empty string. | |
| KindOf (const std::string &value_r) | |
| Ctor from string. | |
| ~KindOf () | |
| Dtor. | |
| const std::string & | asString () const |
| Identification string. | |
| int | compare (const KindOf &rhs) const |
| Order on KindOf (arbitrary). | |
Private Attributes | |
| std::string | _value |
Related Functions | |
| (Note that these are not member functions.) | |
| template<class _Tp> | |
| std::ostream & | operator<< (std::ostream &str, const KindOf< _Tp > &obj) |
| Stream output. | |
| template<class _Tp> | |
| bool | operator== (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
| template<class _Tp> | |
| bool | operator== (const KindOf< _Tp > &lhs, const std::string &rhs) |
| template<class _Tp> | |
| bool | operator== (const std::string &lhs, const KindOf< _Tp > &rhs) |
| template<class _Tp> | |
| bool | operator!= (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
| template<class _Tp> | |
| bool | operator!= (const KindOf< _Tp > &lhs, const std::string &rhs) |
| template<class _Tp> | |
| bool | operator!= (const std::string &lhs, const KindOf< _Tp > &rhs) |
| template<class _Tp> | |
| bool | operator< (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
| Lexicographical order. | |
Example: We have different kinds of Resolvable: Package, Patch, etc. We want some thing to identify these types and have a string value associated. Identification should be constructible from this string. An Enumeration Class could do this, but we would also like to be extensible at runtime.
KindOf stores a lowercased version of a string and uses this as identification.
switch. Definition at line 45 of file KindOf.h.
| zypp::KindOf< _Tp >::KindOf | ( | ) | [inline] |
| zypp::KindOf< _Tp >::KindOf | ( | const std::string & | value_r | ) | [inline, explicit] |
| zypp::KindOf< _Tp >::~KindOf | ( | ) | [inline] |
| const std::string& zypp::KindOf< _Tp >::asString | ( | ) | const [inline] |
Identification string.
Definition at line 63 of file KindOf.h.
References zypp::KindOf< _Tp >::_value.
Referenced by zypp::solver::detail::helixXML(), zypp::parser::susetags::makeSharedIdent(), and zypp::KindOf< _Tp >::operator==().
| int zypp::KindOf< _Tp >::compare | ( | const KindOf< _Tp > & | rhs | ) | const [inline] |
Order on KindOf (arbitrary).
Not necessarily lexicographical.
Definition at line 71 of file KindOf.h.
References zypp::KindOf< _Tp >::_value.
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const KindOf< _Tp > & | obj | |||
| ) | [related] |
| bool operator== | ( | const KindOf< _Tp > & | lhs, | |
| const std::string & | rhs | |||
| ) | [related] |
Definition at line 97 of file KindOf.h.
References zypp::KindOf< _Tp >::asString(), and zypp::str::toLower().
| bool operator== | ( | const std::string & | lhs, | |
| const KindOf< _Tp > & | rhs | |||
| ) | [related] |
Definition at line 102 of file KindOf.h.
References zypp::KindOf< _Tp >::asString(), and zypp::str::toLower().
| bool operator!= | ( | const KindOf< _Tp > & | lhs, | |
| const std::string & | rhs | |||
| ) | [related] |
| bool operator!= | ( | const std::string & | lhs, | |
| const KindOf< _Tp > & | rhs | |||
| ) | [related] |
std::string zypp::KindOf< _Tp >::_value [private] |
Definition at line 76 of file KindOf.h.
Referenced by zypp::KindOf< _Tp >::asString(), and zypp::KindOf< _Tp >::compare().
1.5.3