libdnf5::cli::progressbar

enum class libdnf5::cli::progressbar::ProgressBarState : int

Values:

enumerator READY
enumerator STARTED
enumerator SUCCESS
enumerator WARNING
enumerator ERROR
enum class libdnf5::cli::progressbar::MessageType : int

Values:

enumerator INFO
enumerator SUCCESS
enumerator WARNING
enumerator ERROR
class DescriptionWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
void set_total_width(std::size_t value)
inline void set_width(std::size_t value)
virtual std::string to_string() const override
class DownloadProgressBar : public libdnf5::cli::progressbar::ProgressBar

Public Functions

explicit DownloadProgressBar(int64_t download_size, const std::string &description)
~DownloadProgressBar()
DownloadProgressBar(const DownloadProgressBar &src)
DownloadProgressBar &operator=(const DownloadProgressBar &src)
DownloadProgressBar(DownloadProgressBar &&src) noexcept
DownloadProgressBar &operator=(DownloadProgressBar &&src) noexcept
bool get_number_widget_visible() const noexcept
void set_number_widget_visible(bool value) noexcept
const std::vector<Message> &get_messages() const noexcept
void set_state(ProgressBarState value)
void set_ticks(int64_t value)
void set_total_ticks(int64_t value)
class MultiProgressBar

Public Functions

explicit MultiProgressBar()
~MultiProgressBar()
MultiProgressBar(const MultiProgressBar &src) = delete
MultiProgressBar &operator=(const MultiProgressBar &src) = delete
MultiProgressBar(MultiProgressBar &&src) noexcept = delete
MultiProgressBar &operator=(MultiProgressBar &&src) noexcept = delete
void add_bar(std::unique_ptr<ProgressBar> &&bar)
void print()
DownloadProgressBar &get_total_bar() noexcept

Returns the total bar.

void set_total_bar_visible_limit(std::size_t value) noexcept

Sets the minimum number of registered progress bars to show the total bar.

void set_total_bar_number_widget_visible(bool value) noexcept

Sets the visibility of number widget in the total bar.

void set_total_num_of_bars(std::size_t value) noexcept

Allows one to preset the value of the total number of progress bars. If the value is lower than the current number of registered progress bars, it is automatically increased.

std::size_t get_total_num_of_bars() const noexcept

Returns the total number of progress bars. It can be greater than the current number of registered progress bars.

Public Static Attributes

static constexpr std::size_t NEVER_VISIBLE_LIMIT = static_cast<std::size_t>(-1)

Friends

friend LIBDNF_CLI_API friend std::ostream & operator<< (std::ostream &stream, MultiProgressBar &mbar)
class NumberWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
virtual std::string to_string() const override
class PercentWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
virtual std::string to_string() const override
class ProgressBar

Subclassed by libdnf5::cli::progressbar::DownloadProgressBar

Public Types

using Message = std::pair<MessageType, std::string>

Public Functions

explicit ProgressBar(int64_t total_ticks)
explicit ProgressBar(int64_t total_ticks, const std::string &description)
virtual ~ProgressBar()
ProgressBar(const ProgressBar &src)
ProgressBar &operator=(const ProgressBar &src)
ProgressBar(ProgressBar &&src) noexcept
ProgressBar &operator=(ProgressBar &&src) noexcept
void reset()
int64_t get_ticks() const noexcept
void set_ticks(int64_t value)
void add_ticks(int64_t value)
int64_t get_total_ticks() const noexcept
void set_total_ticks(int64_t value)
int32_t get_number() const noexcept
void set_number(int32_t value)
int32_t get_total() const noexcept
void set_total(int32_t value)
void start()
ProgressBarState get_state() const noexcept
void set_state(ProgressBarState value)
bool is_finished() const noexcept
bool is_failed() const noexcept
std::string get_description() const noexcept
void set_description(const std::string &value)
void add_message(MessageType type, const std::string &message)
void pop_message()

remove the last message

const std::vector<Message> &get_messages() const noexcept
const std::string &get_message_prefix() const noexcept
std::size_t calculate_messages_terminal_lines(std::size_t terminal_width)

Calculate number of lines occupied by messages when printed on terminal of the given width. Takes new lines and wide utf characters into account.

bool get_auto_finish() const noexcept
void set_auto_finish(bool value)
void update()
int32_t get_percent_done() const noexcept
int64_t get_current_speed() const noexcept
int64_t get_average_speed() const noexcept
int64_t get_elapsed_seconds() const noexcept
int64_t get_remaining_seconds() const noexcept
std::chrono::time_point<std::chrono::system_clock> get_begin()

Friends

friend LIBDNF_CLI_API friend std::ostream & operator<< (std::ostream &os, ProgressBar &bar)
class ProgressWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
inline std::size_t get_width() const noexcept
inline void set_width(std::size_t value)
virtual std::string to_string() const override
class SizeWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
virtual std::string to_string() const override
class SpeedWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
virtual std::string to_string() const override
class TimeWidget : public libdnf5::cli::progressbar::Widget

Public Functions

virtual std::size_t get_total_width() const noexcept override
virtual std::string to_string() const override
class Widget

Subclassed by libdnf5::cli::progressbar::DescriptionWidget, libdnf5::cli::progressbar::NumberWidget, libdnf5::cli::progressbar::PercentWidget, libdnf5::cli::progressbar::ProgressWidget, libdnf5::cli::progressbar::SizeWidget, libdnf5::cli::progressbar::SpeedWidget, libdnf5::cli::progressbar::TimeWidget

Public Functions

inline bool get_visible() const noexcept
inline void set_visible(bool value) noexcept
inline ProgressBar *get_bar() const noexcept
inline void set_bar(ProgressBar *value)
virtual std::size_t get_total_width() const noexcept = 0
virtual std::string to_string() const = 0
inline const std::string &get_delimiter_before() const noexcept
inline void set_delimiter_before(const std::string &value)