00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* Helper.h 00003 * 00004 * Static helpers 00005 * 00006 * Copyright (C) 2000-2002 Ximian, Inc. 00007 * Copyright (C) 2005 SUSE Linux Products GmbH 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License, 00011 * version 2, as published by the Free Software Foundation. 00012 * 00013 * This program is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00021 * 02111-1307, USA. 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/CapSet.h" 00032 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 // CLASS NAME : Helper 00048 00049 class Helper { 00050 public: 00051 00052 // for name, find installed item which has same name 00053 // does *NOT* check edition 00054 // FIXME: should probably take provides/obsoletes into account for 00055 // renamed upgrades 00056 static PoolItem_Ref findInstalledByNameAndKind (const ResPool & pool, const std::string & name, const Resolvable::Kind & kind); 00057 00058 // for name, find uninstalled item which has same name 00059 static PoolItem_Ref findUninstalledByNameAndKind (const ResPool & pool, const std::string & name, const Resolvable::Kind & kind); 00060 00061 // for item, find installed item which has same name -> calls findInstalledByNameAndKind() 00062 // does *NOT* check edition 00063 // FIXME: should probably take provides/obsoletes into account for 00064 // renamed upgrades 00065 static PoolItem_Ref findInstalledItem (const ResPool & pool, PoolItem_Ref item); 00066 00067 // for item, find uninstalled item which has same name and higher edition 00068 static PoolItem_Ref findUninstalledItem (const ResPool & pool, PoolItem_Ref item); 00069 00070 // for item, find uninstalled item which has same name and equal edition 00071 static PoolItem_Ref findReinstallItem (const ResPool & pool, PoolItem_Ref item); 00072 00073 static PoolItem_Ref findUpdateItem (const ResPool & pool, PoolItem_Ref item); 00074 00075 friend std::ostream& operator<<(std::ostream&, const PoolItemList & itemlist); 00076 00077 }; 00078 00080 };// namespace detail 00083 };// namespace solver 00086 };// namespace zypp 00088 00089 #endif // ZYPP_SOLVER_DETAIL_HELPER_H