Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / base / SetRelationMixin.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/base/SetRelationMixin.cc
10  */
11
12 #include <map>
13 #include "zypp/base/SetRelationMixin.h"
14
15 ///////////////////////////////////////////////////////////////////
16 namespace zypp
17 {
18   const std::string & _SetCompareDef::asString( Enum val_r )
19   {
20     static std::map<Enum,std::string> _table = {
21       { uncomparable,           "{?}" },
22       { equal,          "{=}" },
23       { properSubset,           "{<}" },
24       { properSuperset, "{>}" },
25       { disjoint,               "{ }" },
26     };
27     return _table[val_r];
28   }
29
30   const std::string & _SetRelationDef::asString( Enum val_r )
31   {
32     static std::map<Enum,std::string> _table = {
33       { uncomparable,           "{??}" },
34       { equal,          "{==}" },
35       { properSubset,           "{<<}" },
36       { properSuperset, "{>>}" },
37       { disjoint,               "{  }" },
38       { subset,         "{<=}" },
39       { superset,               "{>=}" },
40     };
41     return _table[val_r];
42   }
43 } // namespace zypp
44 ///////////////////////////////////////////////////////////////////