25 std::map<std::string,Rel::for_use_in_switch>
_table;
27 std::map<std::string,Rel::for_use_in_switch>::const_iterator findStr(
const std::string & strval_r )
32 _table[
"EQ"] = _table[
"eq"] = _table[
"=="] = _table[
"="] =
Rel::EQ_e;
33 _table[
"NE"] = _table[
"ne"] = _table[
"!="] =
Rel::NE_e;
34 _table[
"LT"] = _table[
"lt"] = _table[
"<"] =
Rel::LT_e;
35 _table[
"LE"] = _table[
"le"] = _table[
"lte"] = _table[
"<="] =
Rel::LE_e;
36 _table[
"GT"] = _table[
"gt"] = _table[
">"] =
Rel::GT_e;
37 _table[
"GE"] = _table[
"ge"] = _table[
"gte"] = _table[
">="] =
Rel::GE_e;
38 _table[
"ANY"] = _table[
"any"] = _table[
"(any)"] = _table[
""] =
Rel::ANY_e;
42 return _table.find( strval_r );
47 std::map<std::string,Rel::for_use_in_switch>::const_iterator it = findStr( strval_r );
48 if ( it == _table.end() )
50 ZYPP_THROW( Exception(
"Rel parse: illegal string value '"+strval_r+
"'") );
57 std::map<std::string,Rel::for_use_in_switch>::const_iterator it = findStr( strval_r );
58 if ( it == _table.end() )
60 return default_r.inSwitch();
82 : _op( parse( strval_r ) )
85 Rel::Rel(
const std::string & strval_r,
const Rel & default_r )
86 : _op( parse( strval_r, default_r ) )
91 std::map<std::string,Rel::for_use_in_switch>::const_iterator it = findStr( strval_r );
92 if ( it == _table.end() )
107 static std::map<for_use_in_switch,std::string>
_table;
108 if ( _table.empty() )
117 _table[
ANY_e] =
"ANY";