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)
inline bool get_number_widget_visible() const noexcept
inline void set_number_widget_visible(bool value) noexcept
inline const std::vector<Message> &get_messages() const noexcept
inline 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()
void add_bar(std::unique_ptr<ProgressBar> &&bar)
inline void print()
inline void set_total_bar_visible_limit(std::size_t value) noexcept

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

inline 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 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() = default
void reset()
inline int64_t get_ticks() const noexcept
void set_ticks(int64_t value)
void add_ticks(int64_t value)
inline int64_t get_total_ticks() const noexcept
void set_total_ticks(int64_t value)
inline int32_t get_number() const noexcept
inline void set_number(int32_t value)
inline int32_t get_total() const noexcept
inline void set_total(int32_t value)
void start()
inline ProgressBarState get_state() const noexcept
inline void set_state(ProgressBarState value)
inline bool is_finished() const noexcept
inline bool is_failed() const noexcept
inline std::string get_description() const noexcept
inline void set_description(const std::string &value)
inline void add_message(MessageType type, const std::string &message)
void pop_message()

remove the last message

inline const std::vector<Message> &get_messages() const noexcept
inline bool get_auto_finish() const noexcept
inline void set_auto_finish(bool value)
void update()
inline int32_t get_percent_done() const noexcept
inline int64_t get_current_speed() const noexcept
inline int64_t get_average_speed() const noexcept
inline int64_t get_elapsed_seconds() const noexcept
inline int64_t get_remaining_seconds() const noexcept
inline 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)