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, UNDETERMINED, TRANSACT);
24 const ResStatus ResStatus::toBeInstalledSoft (UNINSTALLED, UNDETERMINED, TRANSACT, SOFT_INSTALL);
25 const ResStatus ResStatus::toBeUninstalled (INSTALLED, UNDETERMINED, TRANSACT);
26 const ResStatus ResStatus::toBeUninstalledSoft (INSTALLED, UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, SOFT_REMOVE);
27 const ResStatus ResStatus::toBeUninstalledDueToObsolete(INSTALLED, UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_OBSOLETE);
28 const ResStatus ResStatus::toBeUninstalledDueToUpgrade (INSTALLED, UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_UPGRADE);
29 const ResStatus ResStatus::installed (INSTALLED, UNDETERMINED);
30 const ResStatus ResStatus::uninstalled (UNINSTALLED, UNDETERMINED);
31 const ResStatus ResStatus::incomplete (INSTALLED, INCOMPLETE);
32 const ResStatus ResStatus::complete (INSTALLED, SATISFIED);
33 const ResStatus ResStatus::satisfied (UNINSTALLED, SATISFIED);
34 const ResStatus ResStatus::unneeded (UNINSTALLED, UNNEEDED);
35 const ResStatus ResStatus::needed (UNINSTALLED, INCOMPLETE);
36 const ResStatus ResStatus::recommended (RECOMMENDED);
37 const ResStatus ResStatus::suggested (SUGGESTED);
39 ///////////////////////////////////////////////////////////////////
41 // METHOD NAME : ResStatus::ResStatus
44 ResStatus::ResStatus()
47 ///////////////////////////////////////////////////////////////////
49 // METHOD NAME : ResStatus::ResStatus
52 ResStatus::ResStatus( bool isInstalled_r )
53 : _bitfield( isInstalled_r ? INSTALLED : UNINSTALLED )
56 ///////////////////////////////////////////////////////////////////
58 // METHOD NAME : ResStatus::~ResStatus
61 ResStatus::~ResStatus()
65 ResStatus::ResStatus (enum StateValue s, enum EstablishValue e, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
68 fieldValueAssign<EstablishField>(e);
69 fieldValueAssign<TransactField>(t);
71 if (s == INSTALLED) fieldValueAssign<TransactDetailField>(r);
72 else fieldValueAssign<TransactDetailField>(i);
75 fieldValueAssign<SolverStateField>(ssv);
80 /******************************************************************
82 ** FUNCTION NAME : operator<<
83 ** FUNCTION TYPE : std::ostream &
85 std::ostream & operator<<( std::ostream & str, const ResStatus & obj )
87 str << (obj.isInstalled() ? "I" : "U");
89 str << (obj.isEstablishedUneeded() ? "U" :
90 ( obj.isEstablishedSatisfied() ? "S" :
91 ( obj.isEstablishedIncomplete() ? "I" : "_") ) );
93 str << (obj.transacts () ? "T"
94 : (obj.isLocked() ? "L" : "_") );
96 if (obj.isBySolver()) str << "s";
97 else if (obj.isByApplLow()) str << "l";
98 else if (obj.isByApplHigh()) str << "h";
99 else if (obj.isByUser()) str << "u";
101 str << (obj.isToBeUninstalledDueToObsolete() ? "O" :
102 ( obj.isToBeUninstalledDueToUpgrade() ? "U" :
103 ( obj.isToBeInstalledSoft() ? "S" : "_" ) ) );
105 str << (obj.isSeen() ? "@" : "" );
107 str << (obj.isRecommended() ? "r" : "" );
109 str << (obj.isSuggested() ? "s" : "" );
114 /////////////////////////////////////////////////////////////////
116 ///////////////////////////////////////////////////////////////////