lgogdownloader/include/progressbar.h

37 lines
1.2 KiB
C
Raw Permalink Normal View History

2013-03-15 21:46:16 +01:00
/* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
2013-03-24 22:56:57 +01:00
* http://www.wtfpl.net/ for more details. */
2013-03-15 21:46:16 +01:00
#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H
#include <iostream>
#include <vector>
class ProgressBar
{
public:
ProgressBar(bool bUnicode, bool bColor);
virtual ~ProgressBar();
void draw(unsigned int length, double fraction);
std::string createBarString(unsigned int length, double fraction);
2013-03-15 21:46:16 +01:00
protected:
private:
std::vector<std::string> const m_bar_chars;
std::string const m_left_border;
std::string const m_right_border;
std::string const m_simple_left_border;
std::string const m_simple_right_border;
std::string const m_simple_empty_fill;
std::string const m_simple_bar_char;
std::string const m_bar_color;
std::string const m_border_color;
std::string const COLOR_RESET;
bool m_use_unicode;
bool m_use_color;
};
#endif // PROGRESSBAR_H