Helper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ZYPP_SOLVER_DETAIL_HELPER_H
00025 #define ZYPP_SOLVER_DETAIL_HELPER_H
00026
00027 #include <iosfwd>
00028
00029 #include "zypp/ResPool.h"
00030 #include "zypp/PoolItem.h"
00031 #include "zypp/Capabilities.h"
00032 #include "zypp/base/String.h"
00033 #include "zypp/solver/detail/Types.h"
00034
00036 namespace zypp
00037 {
00038
00039 namespace solver
00040 {
00041
00042 namespace detail
00043 {
00044
00046
00047
00048
00049 class Helper {
00050 public:
00051
00052
00053
00054
00055
00056 static PoolItem findInstalledByNameAndKind (const ResPool & pool, const std::string & name, const Resolvable::Kind & kind);
00057
00058
00059 static PoolItem findUninstalledByNameAndKind (const ResPool & pool, const std::string & name, const Resolvable::Kind & kind);
00060
00061
00062
00063
00064
00065 static PoolItem findInstalledItem (const ResPool & pool, PoolItem item);
00067 static PoolItem findInstalledItem (const std::vector<PoolItem> & pool, PoolItem item);
00068
00069
00070 static PoolItem findUninstalledItem (const ResPool & pool, PoolItem item);
00071
00072
00073 static PoolItem findReinstallItem (const ResPool & pool, PoolItem item);
00074
00075 static PoolItem findUpdateItem (const ResPool & pool, PoolItem item);
00077 static PoolItem findUpdateItem (const std::vector<PoolItem> & pool, PoolItem item);
00078
00079
00080 static bool isBestUninstalledItem (const ResPool & pool, PoolItem item);
00081
00082
00083 static std::string itemToString (PoolItem item, bool shortVersion=false);
00084 static std::string capToString (const Capability & capability);
00085
00086 friend std::ostream& operator<<(std::ostream&, const PoolItemList & itemlist);
00087
00088 };
00089
00091 };
00094 };
00097 };
00099
00100 #endif // ZYPP_SOLVER_DETAIL_HELPER_H