terminal_status_line/Progress.h
2025-10-27 17:07:57 +02:00

30 lines
545 B
C++

#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_