2019-06-04 19:54:00 +00:00
|
|
|
#ifndef PROGRESS_HPP
|
|
|
|
#define PROGRESS_HPP
|
|
|
|
|
2020-01-17 13:05:30 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <Windows.h>
|
|
|
|
using string = std::wstring;
|
|
|
|
#else
|
|
|
|
using string = std::string;
|
|
|
|
#endif
|
|
|
|
|
2020-02-25 09:10:40 +00:00
|
|
|
#define PROGRESS_PERC 0x4000
|
|
|
|
#define PROGRESS_STRING 0x4001
|
|
|
|
|
2020-01-17 13:05:30 +00:00
|
|
|
class ProgressBar {
|
|
|
|
public:
|
|
|
|
#ifndef GUI
|
|
|
|
ProgressBar() = default;
|
|
|
|
~ProgressBar() = default;
|
|
|
|
#else
|
|
|
|
#ifndef _WIN32
|
|
|
|
ProgressBar( void *pw ) : ptr( pw ){};
|
|
|
|
#else
|
2020-02-25 09:10:40 +00:00
|
|
|
ProgressBar( void *hwnd ) : ptr( hwnd ){};
|
2020-01-17 13:05:30 +00:00
|
|
|
#endif // _WIN32
|
|
|
|
~ProgressBar();
|
|
|
|
#endif // GUI
|
|
|
|
void print( int perc );
|
|
|
|
void print( const string &t );
|
|
|
|
#ifdef GUI
|
|
|
|
private:
|
|
|
|
void *ptr;
|
|
|
|
#endif
|
2019-06-04 19:54:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|