ResolverInfoChildOf.cc

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* ResolverInfoChildOf.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/ResolverInfoChildOf.h"
00026 #include "zypp/base/String.h"
00027 #include "zypp/base/Gettext.h"
00028 
00030 namespace zypp 
00031 { 
00032 
00033   namespace solver
00034   { 
00035 
00036     namespace detail
00037     { 
00038 
00039 using namespace std;
00040 
00041 IMPL_PTR_TYPE(ResolverInfoChildOf);
00042 
00043 //---------------------------------------------------------------------------
00044 
00045 
00046 std::ostream &
00047 ResolverInfoChildOf::dumpOn( std::ostream & os ) const
00048 {
00049     os << "<resolverinfochildof '";
00050     ResolverInfo::dumpOn (os);
00051 
00052     ostringstream affected_str;
00053     affected_str << ResolverInfo::toString (affected());
00054 
00055     //Translator all.%s = name of packages,patches,....
00056     os << str::form (_("%s part of %s"),
00057                             affected_str.str().c_str(),
00058                             itemsToString(false).c_str());
00059     os << "'>";
00060     return os;
00061 }
00062 
00063 string
00064 ResolverInfoChildOf::message( ) const
00065 {
00066     string affected_str = ResolverInfo::toString(affected());
00067     string container_str = itemsToString( true );
00068 
00069     // TranslatorExplanation: 1.%s name of package, 2.%s list of names
00070     // TranslatorExplanation: 1.%s is part of 'bundles', the bundles are listed in 2.%s
00071     return str::form (_("%s part of %s"),
00072                         affected_str.c_str(),
00073                         container_str.c_str());
00074 }
00075 
00076 //---------------------------------------------------------------------------
00077 
00078 ResolverInfoChildOf::ResolverInfoChildOf (PoolItem_Ref item, PoolItem_Ref dependency)
00079     : ResolverInfoContainer (RESOLVER_INFO_TYPE_CHILD_OF, item, RESOLVER_INFO_PRIORITY_USER, dependency)
00080 {
00081 }
00082 
00083 
00084 ResolverInfoChildOf::~ResolverInfoChildOf ()
00085 {
00086 }
00087 
00088 //---------------------------------------------------------------------------
00089 
00090 
00091 ResolverInfo_Ptr
00092 ResolverInfoChildOf::copy (void) const
00093 {
00094     ResolverInfoChildOf_Ptr cpy = new ResolverInfoChildOf(affected(), PoolItem_Ref());
00095 
00096     ((ResolverInfoContainer_Ptr)cpy)->copy (this);
00097 
00098     return cpy;
00099 }
00100 
00102     };// namespace detail
00105   };// namespace solver
00108 };// namespace zypp
00110 

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