Added everything
This commit is contained in:
29
Progress.h
Normal file
29
Progress.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef PROGRESS_H_
|
||||
#define PROGRESS_H_
|
||||
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
class Progress
|
||||
{
|
||||
protected:
|
||||
size_t m_current;
|
||||
size_t m_total;
|
||||
|
||||
std::string m_message;
|
||||
|
||||
public:
|
||||
Progress(const std::string& message, size_t total, size_t current = 0);
|
||||
|
||||
void set_total(size_t total);
|
||||
void set_progress(size_t current);
|
||||
void set_message(const std::string& message);
|
||||
|
||||
void increment_progress(size_t inc = 1);
|
||||
|
||||
std::string print_progress();
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const Progress& progress);
|
||||
};
|
||||
|
||||
#endif // PROGRESS_H_
|
||||
Reference in New Issue
Block a user