1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ResStatus.cc
13 //#include "zypp/base/Logger.h"
15 #include "zypp/ResStatus.h"
19 ///////////////////////////////////////////////////////////////////
21 { /////////////////////////////////////////////////////////////////
23 const ResStatus ResStatus::toBeInstalled (UNINSTALLED, TRANSACT);
24 const ResStatus ResStatus::toBeInstalledSoft (UNINSTALLED, TRANSACT, SOFT_INSTALL);
25 const ResStatus ResStatus::toBeUninstalled (INSTALLED, TRANSACT);
26 const ResStatus ResStatus::toBeUninstalledSoft (INSTALLED, TRANSACT, EXPLICIT_INSTALL, SOFT_REMOVE);
27 const ResStatus ResStatus::toBeUninstalledDueToObsolete(INSTALLED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_OBSOLETE);
28 const ResStatus ResStatus::toBeUninstalledDueToUpgrade (INSTALLED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_UPGRADE);
29 const ResStatus ResStatus::installed (INSTALLED);
30 const ResStatus ResStatus::uninstalled (UNINSTALLED);
32 ///////////////////////////////////////////////////////////////////
34 // METHOD NAME : ResStatus::ResStatus
37 ResStatus::ResStatus()
40 ///////////////////////////////////////////////////////////////////
42 // METHOD NAME : ResStatus::ResStatus
45 ResStatus::ResStatus( bool isInstalled_r )
46 : _bitfield( isInstalled_r ? INSTALLED : UNINSTALLED )
49 ///////////////////////////////////////////////////////////////////
51 // METHOD NAME : ResStatus::~ResStatus
54 ResStatus::~ResStatus()
58 ResStatus::ResStatus (enum StateValue s, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
61 fieldValueAssign<TransactField>(t);
63 if (s == INSTALLED) fieldValueAssign<TransactDetailField>(r);
64 else fieldValueAssign<TransactDetailField>(i);
67 fieldValueAssign<SolverStateField>(ssv);
72 /******************************************************************
74 ** FUNCTION NAME : operator<<
75 ** FUNCTION TYPE : std::ostream &
77 std::ostream & operator<<( std::ostream & str, const ResStatus & obj )
79 str << (obj.isInstalled() ? "I" : "U");
81 str << (obj.transacts () ? "T"
82 : (obj.isLocked() ? "L" : "_") );
84 if (obj.isBySolver()) str << "s";
85 else if (obj.isByApplLow()) str << "l";
86 else if (obj.isByApplHigh()) str << "h";
87 else if (obj.isByUser()) str << "u";
89 str << (obj.isToBeUninstalledDueToObsolete() ? "O" :
90 ( obj.isToBeUninstalledDueToUpgrade() ? "U" :
91 ( obj.isToBeInstalledSoft() ? "S" : "_" ) ) );
93 str << (obj.isSeen() ? "@" : "" );
95 str << (obj.isRecommended() ? "r" : "" );
97 str << (obj.isSuggested() ? "s" : "" );
102 /////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////