ProblemSolutionKeep.cc

Go to the documentation of this file.
00001 
00002 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00003 /* ProblemSolution.cc
00004  *
00005  * Easy-to use interface to the ZYPP dependency resolver
00006  *
00007  * Copyright (C) 2000-2002 Ximian, Inc.
00008  * Copyright (C) 2005 SUSE Linux Products GmbH
00009  *
00010  * This program is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU General Public License,
00012  * version 2, as published by the Free Software Foundation.
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00022  * 02111-1307, USA.
00023  */
00024 
00025 #include <sstream>
00026 
00027 #include "zypp/base/String.h"
00028 #include "zypp/base/Gettext.h"
00029 #include "zypp/solver/detail/ProblemSolutionKeep.h"
00030 #include "zypp/solver/detail/ResolverInfo.h"
00031 
00032 using namespace std;
00033 
00035 namespace zypp
00036 { 
00037 
00038   namespace solver
00039   { 
00040 
00041     namespace detail
00042     { 
00043 
00044 IMPL_PTR_TYPE(ProblemSolutionKeep);
00045 
00046 //---------------------------------------------------------------------------
00047 
00048 ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
00049                                                 PoolItem_Ref item )
00050     : ProblemSolution (parent, "", "")
00051 {
00052     // TranslatorExplanation %s = name of package, patch, selection ...    
00053     _description = str::form (_("keep %s"), item->name().c_str() );
00054     // TranslatorExplanation %s = name of package, patch, selection ...      
00055     _details = str::form (_("keep %s"), ResolverInfo::toString (item).c_str());
00056 
00057     addAction ( new TransactionSolutionAction (item,
00058                                                KEEP));
00059 }
00060 
00061 ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
00062                                           PoolItemList & itemList )
00063     : ProblemSolution (parent, "", "")
00064 {
00065     _description = _("Keep resolvables");
00066 
00067     for (PoolItemList::iterator iter = itemList.begin();
00068          iter != itemList.end(); iter++) {
00069         PoolItem_Ref item = *iter;
00070         addAction ( new TransactionSolutionAction (item, KEEP));
00071     }
00072 
00073     ostringstream details;
00074     details << _actions;    
00075     _details = details.str();
00076     
00077 }
00078 
00080     };// namespace detail
00083   };// namespace solver
00086 };// namespace zypp

Generated on Thu Jul 6 00:07:23 2006 for zypp by  doxygen 1.4.6