]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/progress.h
merge patch from Daniel Hartwig to Show a error message if {,dist-}upgrade is used...
[apt.git] / apt-pkg / contrib / progress.h
index 094c4b016d2889883f27a15edd0cf688fc14501c..3a6943aee5731325a70b1913b3a29aabc0fab76a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: progress.h,v 1.4 1998/10/02 04:39:54 jgg Exp $
+// $Id: progress.h,v 1.6 2001/05/07 05:06:52 jgg Exp $
 /* ######################################################################
    
    OpProgress - Operation Progress
    
    ##################################################################### */
                                                                        /*}}}*/
-// Header section: pkglib
 #ifndef PKGLIB_PROGRESS_H
 #define PKGLIB_PROGRESS_H
 
-#ifdef __GNUG__
-#pragma interface "apt-pkg/progress.h"
-#endif 
 
 #include <string>
 #include <sys/time.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class Configuration;
 class OpProgress
 {
-   unsigned long Current;
-   unsigned long Total;
-   unsigned long Size;
-   unsigned long SubTotal;
+   unsigned long long Current;
+   unsigned long long Total;
+   unsigned long long Size;
+   unsigned long long SubTotal;
    float LastPercent;
    
    // Change reduction code
    struct timeval LastTime;
-   string LastOp;
-   string LastSubOp;
+   std::string LastOp;
+   std::string LastSubOp;
    
    protected:
    
-   string Op;
-   string SubOp;
+   std::string Op;
+   std::string SubOp;
    float Percent;
    
    bool MajorChange;
@@ -56,11 +56,10 @@ class OpProgress
    
    public:
    
-   void Progress(unsigned long Current);
-   void SubProgress(unsigned long SubTotal);
-   void SubProgress(unsigned long SubTotal,string Op);
-   void OverallProgress(unsigned long Current,unsigned long Total,
-                       unsigned long Size,string Op);
+   void Progress(unsigned long long Current);
+   void SubProgress(unsigned long long SubTotal, const std::string &Op = "", float const Percent = -1);
+   void OverallProgress(unsigned long long Current,unsigned long long Total,
+                       unsigned long long Size,const std::string &Op);
    virtual void Done() {};
    
    OpProgress();
@@ -70,8 +69,8 @@ class OpProgress
 class OpTextProgress : public OpProgress
 {
    protected:
-   
-   string OldOp;
+
+   std::string OldOp;
    bool NoUpdate;
    bool NoDisplay;
    unsigned long LastLen;