misc/libphysfs/lzma/CPP/7zip/UI/Console/PercentPrinter.h
changeset 13881 99b265e0d1d0
parent 13880 5f819b90d479
child 13882 b172a5d40eee
equal deleted inserted replaced
13880:5f819b90d479 13881:99b265e0d1d0
     1 // PercentPrinter.h
       
     2 
       
     3 #ifndef __PERCENTPRINTER_H
       
     4 #define __PERCENTPRINTER_H
       
     5 
       
     6 #include "Common/Types.h"
       
     7 #include "Common/StdOutStream.h"
       
     8 
       
     9 class CPercentPrinter
       
    10 {
       
    11   UInt64 m_MinStepSize;
       
    12   UInt64 m_PrevValue;
       
    13   UInt64 m_CurValue;
       
    14   UInt64 m_Total;
       
    15   int m_NumExtraChars;
       
    16 public:
       
    17   CStdOutStream *OutStream;
       
    18 
       
    19   CPercentPrinter(UInt64 minStepSize = 1): m_MinStepSize(minStepSize), 
       
    20       m_PrevValue(0), m_CurValue(0), m_Total(1), m_NumExtraChars(0) {}
       
    21   void SetTotal(UInt64 total) { m_Total = total; m_PrevValue = 0; }
       
    22   void SetRatio(UInt64 doneValue) { m_CurValue = doneValue; }
       
    23   void PrintString(const char *s);
       
    24   void PrintString(const wchar_t *s);
       
    25   void PrintNewLine();
       
    26   void ClosePrint();
       
    27   void RePrintRatio();
       
    28   void PrintRatio();
       
    29 };
       
    30 
       
    31 #endif