forked from brucedjones/pyck
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprogressBar.h
More file actions
43 lines (36 loc) · 1.25 KB
/
progressBar.h
File metadata and controls
43 lines (36 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef PROGRESS_BAR_H
#define PROGRESS_BAR_H
#include <string>
class ProgressBar {
public:
/**
* ProgressBar Constructor
* @param maxVal The value (Which would be passed to UpdateProgress) which indicates completion
* @param label Label to be printed with the progress bar
*/
ProgressBar(long maxVal, std::string label);
~ProgressBar(){};
/**
* Updates the progress bard
* @param currVal Current progress value
*/
void UpdateProgress(long currVal);
/**
* Finalizes the progressBar, does a final draw at 100% and flushes cout
*/
void Finish();
private:
/**
* Handles output for the progressBar
* @param percent The current percentage value to display
*/
void Draw(int percent);
long currVal; /**< Current progress value */
long prevVal; /**< Previous progress value */
long numBars; /**< Number of progress bars to use */
long maxVal; /**< Maximum progress value */
float increment; /**< Progress represented by a single bar */
std::string bar; /**< String containing the progress bar for output */
std::string label; /**< String containing the label to be output with the progress bar */
};
#endif