Console Library 4.7.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::ProgressConfig Struct Reference

进度条显示配置。 More...

#include <progress.h>

Public Member Functions

 ProgressConfig (std::ostream &o=std::cout, int w=50, std::string fc="#", std::string ec=".", std::string pre="[", std::string suf="]", bool sp=true)
 构造一个进度条配置对象。

Public Attributes

std::ostream & os
 输出目标流,默认为 std::cout。
int width
 进度条的宽度(字符数)。
std::string fill_char
 已填充部分使用的字符(如 "#")。
std::string empty_char
 未填充部分使用的字符(如 ".")。
std::string prefix
 进度条前缀字符串(如 "[")。
std::string suffix
 进度条后缀字符串(如 "]"]。
bool show_percent
 是否在进度条后显示百分比数字。

Detailed Description

进度条显示配置。

该结构体控制进度条的外观和行为,包括输出流、宽度、填充字符、前后缀以及是否显示百分比。

Constructor & Destructor Documentation

◆ ProgressConfig()

console::ProgressConfig::ProgressConfig ( std::ostream & o = std::cout,
int w = 50,
std::string fc = "#",
std::string ec = ".",
std::string pre = "[",
std::string suf = "]",
bool sp = true )
inline

构造一个进度条配置对象。

Parameters
o输出流,默认为 std::cout。
w进度条宽度(字符数),默认为 50。
fc填充字符,默认为 "#"。
ec空白字符,默认为 "."。
pre前缀字符串,默认为 "["。
suf后缀字符串,默认为 "]".
sp是否显示百分比,默认为 true。

Member Data Documentation

◆ empty_char

std::string console::ProgressConfig::empty_char

未填充部分使用的字符(如 ".")。

◆ fill_char

std::string console::ProgressConfig::fill_char

已填充部分使用的字符(如 "#")。

◆ os

std::ostream& console::ProgressConfig::os

输出目标流,默认为 std::cout。

◆ prefix

std::string console::ProgressConfig::prefix

进度条前缀字符串(如 "[")。

◆ show_percent

bool console::ProgressConfig::show_percent

是否在进度条后显示百分比数字。

◆ suffix

std::string console::ProgressConfig::suffix

进度条后缀字符串(如 "]"]。

◆ width

int console::ProgressConfig::width

进度条的宽度(字符数)。


The documentation for this struct was generated from the following file: