#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.) | |
std::ostream & | operator<< (std::ostream &str, const KindOf< _Tp > &obj) |
bool | operator== (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
bool | operator== (const KindOf< _Tp > &lhs, const std::string &rhs) |
bool | operator== (const std::string &lhs, const KindOf< _Tp > &rhs) |
bool | operator!= (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
bool | operator!= (const KindOf< _Tp > &lhs, const std::string &rhs) |
bool | operator!= (const std::string &lhs, const KindOf< _Tp > &rhs) |
bool | operator< (const KindOf< _Tp > &lhs, const KindOf< _Tp > &rhs) |
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
. Make lowercased/uppercased/etc an option. First of all get rid of the string::toLower calls operator.
Maybe collaboration with some sort of Registry.
Definition at line 45 of file KindOf.h.
|
DefaultCtor: empty string.
|
|
Ctor from string. Lowercase version of value_r is used as identification. |
|
Dtor.
|
|
Identification string.
Definition at line 63 of file KindOf.h. References zypp::KindOf< _Tp >::_value. Referenced by zypp::KindOf< _Tp >::operator==(). |
|
Order on KindOf (arbitrary). Not necessarily lexicographical.
Definition at line 71 of file KindOf.h. References zypp::KindOf< _Tp >::_value. |
|
Stream output |
|
Definition at line 92 of file KindOf.h. References zypp::KindOf< _Tp >::asString(). |
|
Definition at line 97 of file KindOf.h. References zypp::KindOf< _Tp >::asString(), and zypp::str::toLower(). |
|
Definition at line 102 of file KindOf.h. References zypp::KindOf< _Tp >::asString(), and zypp::str::toLower(). |
|
|
|
|
|
|
|
Lexicographical order. |
|
Definition at line 76 of file KindOf.h. Referenced by zypp::KindOf< _Tp >::asString(), and zypp::KindOf< _Tp >::compare(). |