UpgradeStatistics.cc

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*---------------------------------------------------------------------\
00003 |                          ____ _   __ __ ___                          |
00004 |                         |__  / \ / / . \ . \                         |
00005 |                           / / \ V /|  _/  _/                         |
00006 |                          / /__ | | | | | |                           |
00007 |                         /_____||_| |_| |_|                           |
00008 |                                                                      |
00009 \---------------------------------------------------------------------*/
00010 /* UpgradeStatistics.cc
00011  *
00012  * Copyright (C) 2005 SUSE Linux Products GmbH
00013  *
00014  * This program is free software; you can redistribute it and/or
00015  * modify it under the terms of the GNU General Public License,
00016  * version 2, as published by the Free Software Foundation.
00017  *
00018  * This program is distributed in the hope that it will be useful, but
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00026  * 02111-1307, USA.
00027  */
00028 
00029 /*
00030   stolen from PMPackageManager_update.cc
00031   original author Michael Andres <ma@suse.de>
00032   zypp port by Klaus Kaempf <kkaempf@suse.de>
00033 
00034 /-*/
00035 
00036 #include <iostream>
00037 #include "zypp/base/Logger.h"
00038 #include "zypp/UpgradeStatistics.h"
00039 
00041 namespace zypp
00042 { 
00043 
00044 using namespace std;
00045 
00046 UpgradeStatistics::~UpgradeStatistics()
00047 {}
00048 
00049 /******************************************************************
00050 **
00051 **
00052 **      FUNCTION NAME : operator<<
00053 **      FUNCTION TYPE : std::ostream &
00054 **
00055 **      DESCRIPTION :
00056 */
00057 std::ostream &
00058 UpgradeStatistics::dumpOn( std::ostream & str ) const
00059 {
00060   str << "===[options]========================================" << endl;
00061   str << "delete_unmaintained? " << (delete_unmaintained?"Y":"N") << endl;
00062   str << "===[initial]========================================" << endl;
00063   str << "pre_todel            " << pre_todel << endl;
00064   str << "pre_nocand           " << pre_nocand << endl;
00065   str << "pre_avcand           " << pre_avcand << endl;
00066   str << "===[checks]=========================================" << endl;
00067   str << "chk_installed_total  " << chk_installed_total << endl;
00068   str << endl;
00069   str << "chk_already_todel    " << chk_already_todel << endl;
00070   str << "chk_is_taboo         " << chk_is_taboo << endl;
00071   str << endl;
00072   str << "chk_already_toins    " << chk_already_toins << endl;
00073   str << "chk_to_update        " << chk_to_update << endl;
00074   str << "chk_to_downgrade     " << chk_to_downgrade << endl;
00075   str << "chk_to_keep_downgrade" << chk_to_keep_downgrade << endl;
00076   str << "chk_to_keep_installed" << chk_to_keep_installed << endl;
00077   str << "--------------------------" << endl;
00078   str << "avcand               "
00079     <<  ( chk_already_toins + chk_to_update + chk_to_downgrade + chk_to_keep_downgrade + chk_to_keep_installed )
00080       << endl;
00081   str << endl;
00082   str << "chk_keep_foreign     " << chk_keep_foreign << endl;
00083   str << "chk_dropped          " << chk_dropped << endl;
00084   str << "chk_replaced         " << chk_replaced << endl;
00085   str << "chk_replaced_guessed " << chk_replaced_guessed << endl;
00086   str << "chk_add_split        " << chk_add_split << endl;
00087   str << "--------------------------" << endl;
00088   str << "nocand               "
00089     <<  ( chk_keep_foreign + chk_dropped + chk_replaced + chk_replaced_guessed + chk_add_split )
00090       << endl;
00091   str << "===[sum]============================================" << endl;
00092   str << "Packages checked     " << chk_installed_total << endl;
00093   str << endl;
00094   str << "totalToInstall       " << totalToInstall() << endl;
00095   str << "totalToDelete        " << totalToDelete() << endl;
00096   str << "totalToKeep          " << totalToKeep() << endl;
00097   str << "--------------------------" << endl;
00098   str << "sum                  "
00099     <<  ( totalToInstall() + totalToDelete() + totalToKeep() )
00100       << endl;
00101   str << "====================================================" << endl;
00102   str << "====================================================" << endl;
00103 
00104   return str;
00105 }
00106 
00107 
00109 };// namespace zypp
00111 
00112 

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