ResolverInfoConflictsWith.cc

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* ResolverInfoConflictsWith.cc
00003  *
00004  * Copyright (C) 2000-2002 Ximian, Inc.
00005  * Copyright (C) 2005 SUSE Linux Products GmbH
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License,
00009  * version 2, as published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019  * 02111-1307, USA.
00020  */
00021 
00022 #include <map>
00023 #include <sstream>
00024 
00025 #include "zypp/solver/detail/ResolverInfo.h"
00026 #include "zypp/solver/detail/ResolverInfoConflictsWith.h"
00027 #include "zypp/base/String.h"
00028 #include "zypp/base/Gettext.h"
00029 
00031 namespace zypp 
00032 { 
00033 
00034   namespace solver
00035   { 
00036 
00037     namespace detail
00038     { 
00039 
00040 using namespace std;
00041 
00042 IMPL_PTR_TYPE(ResolverInfoConflictsWith);
00043 
00044 //---------------------------------------------------------------------------
00045 
00046 
00047 std::ostream &
00048 ResolverInfoConflictsWith::dumpOn( std::ostream & os ) const
00049 {
00050     ResolverInfo::dumpOn (os);
00051     ostringstream affected_str;
00052     affected_str << ResolverInfo::toString (affected());
00053 
00054     // Translator: all.%s = name of package, patch,...
00055     os << str::form (_("%s conflicts with %s"),
00056                             affected_str.str().c_str(),
00057                             itemsToString(false).c_str());
00058     return os;
00059 }
00060 
00061 
00062 string
00063 ResolverInfoConflictsWith::message( ) const
00064 {
00065     string affected_str = ResolverInfo::toString(affected());
00066     string container_str = itemsToString( true );
00067 
00068     // TranslatorExplanation: 1.%s name of package, 2.%s list of names
00069     // TranslatorExplanation: 1.%s is conflicting with multiple others
00070     return str::form (_("%s conflicts with %s"),
00071                         affected_str.c_str(),
00072                         container_str.c_str());
00073 }
00074 
00075 //---------------------------------------------------------------------------
00076 
00077 ResolverInfoConflictsWith::ResolverInfoConflictsWith (PoolItem_Ref item, PoolItem_Ref with,
00078                                                       const Capability & capability)
00079     : ResolverInfoContainer (RESOLVER_INFO_TYPE_CONFLICTS_WITH, item, RESOLVER_INFO_PRIORITY_USER, with)
00080     , _capability (capability)
00081 {
00082 }
00083 
00084 
00085 ResolverInfoConflictsWith::~ResolverInfoConflictsWith ()
00086 {
00087 }
00088 
00089 
00090 //---------------------------------------------------------------------------
00091 
00092 ResolverInfo_Ptr
00093 ResolverInfoConflictsWith::copy (void) const
00094 {
00095     ResolverInfoConflictsWith_Ptr cpy = new ResolverInfoConflictsWith(affected(), PoolItem_Ref(),
00096                                                                       capability());
00097 
00098     ((ResolverInfoContainer_Ptr)cpy)->copy (this);
00099 
00100     return cpy;
00101 }
00102 
00104     };// namespace detail
00107   };// namespace solver
00110 };// namespace zypp
00112 

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