aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/UI/Console/PercentPrinter.h
diff options
context:
space:
mode:
authorrepo sync <gcondra@google.com>2013-07-26 17:53:31 -0700
committerrepo sync <gcondra@google.com>2013-07-29 11:00:59 -0700
commitbaa3858d3f5d128a5c8466b700098109edcad5f2 (patch)
tree2860fc3eaf476caa6296788b828f296a5ee37486 /CPP/7zip/UI/Console/PercentPrinter.h
parentdd8f4f771627dacc36cd45f18c2b54f939471065 (diff)
downloadlzma-baa3858d3f5d128a5c8466b700098109edcad5f2.tar.gz
The only change from stock lzma sdk is the removal of two .exe files, which we don't need. Change-Id: I46287cbc416161e93b449761ebe531acd758cf95
Diffstat (limited to 'CPP/7zip/UI/Console/PercentPrinter.h')
-rwxr-xr-xCPP/7zip/UI/Console/PercentPrinter.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/CPP/7zip/UI/Console/PercentPrinter.h b/CPP/7zip/UI/Console/PercentPrinter.h
new file mode 100755
index 0000000..212e11e
--- /dev/null
+++ b/CPP/7zip/UI/Console/PercentPrinter.h
@@ -0,0 +1,31 @@
+// PercentPrinter.h
+
+#ifndef __PERCENTPRINTER_H
+#define __PERCENTPRINTER_H
+
+#include "Common/Types.h"
+#include "Common/StdOutStream.h"
+
+class CPercentPrinter
+{
+ UInt64 m_MinStepSize;
+ UInt64 m_PrevValue;
+ UInt64 m_CurValue;
+ UInt64 m_Total;
+ int m_NumExtraChars;
+public:
+ CStdOutStream *OutStream;
+
+ CPercentPrinter(UInt64 minStepSize = 1): m_MinStepSize(minStepSize),
+ m_PrevValue(0), m_CurValue(0), m_Total(1), m_NumExtraChars(0) {}
+ void SetTotal(UInt64 total) { m_Total = total; m_PrevValue = 0; }
+ void SetRatio(UInt64 doneValue) { m_CurValue = doneValue; }
+ void PrintString(const char *s);
+ void PrintString(const wchar_t *s);
+ void PrintNewLine();
+ void ClosePrint();
+ void RePrintRatio();
+ void PrintRatio();
+};
+
+#endif