diff --git a/bin/main.cpp b/bin/main.cpp index 3f20491..374900f 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -11,19 +11,26 @@ void print_in_color(const T& text, const std::string& color) } template -std::string get_size_string(const T& size) { - if (size < 1024) { +std::string get_size_string(const T& size) +{ + if (size < 1024) + { return std::to_string(size) + " B"; - } else if (size < 1024 * 1024) { + } + else if (size < 1024 * 1024) + { return std::to_string(size / 1024) + " KB"; - } else if (size < 1024 * 1024 * 1024) { + } + else if (size < 1024 * 1024 * 1024) + { return std::to_string(size / 1024 / 1024) + " MB"; - } else { + } + else + { return std::to_string(size / 1024 / 1024 / 1024) + " GB"; } } - auto main() -> int { std::ifstream fs("/etc/mtab"); @@ -39,8 +46,8 @@ auto main() -> int continue; } - unsigned long long total_size = (unsigned long long) stat.f_frsize * stat.f_blocks; - unsigned long long free_size = (unsigned long long) stat.f_frsize * stat.f_bfree; + unsigned long long total_size = (unsigned long long)stat.f_frsize * stat.f_blocks; + unsigned long long free_size = (unsigned long long)stat.f_frsize * stat.f_bfree; unsigned long long used_size = total_size - free_size; std::cout << "Точка монтирования: " << mount_entry->mnt_dir << "\n";