Skip to content

A very simple C++ console progressbar header file. 一个易用的C++控制台进度条头文件库

License

Notifications You must be signed in to change notification settings

ZhengqiaoWang/JProgressBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JProgressBar

[中文]

This is a very simple and easy to use C++ progress bar header file. You only need to refer to the examples in example to get started very easily.

Here's how it works.

example

Its source code is.

#include "jprogress_bar.hpp"
#include <thread>
using namespace Joger::ProgressBar;

...

    {
        printf("task1: calc something\n");
        JProgressBar bar(100);
        for (double i = 0; i <= 100; ++i)
        {
            bar.update(i);
            std::this_thread::sleep_for(std::chrono::milliseconds(10));
        }
        bar.end();
    }

    {
        printf("task2: send files\n");
        JProgressBar bar(1024.6); // 1024.6MB
        for (double i = 0; i <= 100; ++i)
        {
            bar.update(i);
            std::this_thread::sleep_for(std::chrono::milliseconds(10));
        }
        bar.end();
    }

Features

Customize the style of the progress bar.

You can customize the style of the progress bar by modifying the constants defined in the header file

By default it looks like this.

Can adapt to the console width

The default progress bar takes up 80% of the console width, so you don't have to pay attention to the console width.

Cross platforms

Support both linux and windows.

Stargazers

Stargazers repo roster for @ZhengqiaoWang/JProgressBar

Forkers

Forkers repo roster for @ZhengqiaoWang/JProgressBar

About

A very simple C++ console progressbar header file. 一个易用的C++控制台进度条头文件库

Topics

Resources

License

Stars

Watchers

Forks