From 29c6d78edb88a38c2bfde54fc7ecccc691bbef30 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 16 Mar 2016 22:57:15 -0400 Subject: Added verbly submodule --- verbly/generator/progress.h | 50 --------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 verbly/generator/progress.h (limited to 'verbly/generator/progress.h') diff --git a/verbly/generator/progress.h b/verbly/generator/progress.h deleted file mode 100644 index 81f07a3..0000000 --- a/verbly/generator/progress.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef PROGRESS_H_A34EF856 -#define PROGRESS_H_A34EF856 - -#include - -class progress { - private: - std::string message; - int total; - int cur = 0; - int lprint = 0; - - public: - progress(std::string message, int total) : message(message), total(total) - { - std::cout << message << " 0%" << std::flush; - } - - void update(int val) - { - if (val <= total) - { - cur = val; - } else { - cur = total; - } - - int pp = cur * 100 / total; - if (pp != lprint) - { - lprint = pp; - - std::cout << "\b\b\b\b" << std::right; - std::cout.width(3); - std::cout << pp << "%" << std::flush; - } - } - - void update() - { - update(cur+1); - } - - ~progress() - { - std::cout << "\b\b\b\b100%" << std::endl; - } -}; - -#endif /* end of include guard: PROGRESS_H_A34EF856 */ -- cgit 1.4.1