2020-05-03 07:30:09 +03:00
|
|
|
/*
|
2022-12-10 11:52:46 +03:00
|
|
|
* Copyright (c) 2020-2022, the SerenityOS developers.
|
2020-05-03 07:30:09 +03:00
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-05-03 07:30:09 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-04 21:02:33 +03:00
|
|
|
#include <AK/DeprecatedString.h>
|
2020-05-03 07:30:09 +03:00
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
2022-12-15 16:31:38 +03:00
|
|
|
enum class HumanReadableBasedOn {
|
|
|
|
Base2,
|
|
|
|
Base10
|
|
|
|
};
|
|
|
|
|
|
|
|
DeprecatedString human_readable_size(u64 size, HumanReadableBasedOn based_on = HumanReadableBasedOn::Base2);
|
|
|
|
DeprecatedString human_readable_quantity(u64 quantity, HumanReadableBasedOn based_on = HumanReadableBasedOn::Base2, StringView unit = "B"sv);
|
2022-12-10 12:01:10 +03:00
|
|
|
|
2022-12-10 11:52:46 +03:00
|
|
|
DeprecatedString human_readable_size_long(u64 size);
|
|
|
|
DeprecatedString human_readable_time(i64 time_in_seconds);
|
|
|
|
DeprecatedString human_readable_digital_time(i64 time_in_seconds);
|
2022-08-04 16:36:18 +03:00
|
|
|
|
2020-05-03 07:30:09 +03:00
|
|
|
}
|
|
|
|
|
2022-11-26 14:18:30 +03:00
|
|
|
#if USING_AK_GLOBALLY
|
2022-08-04 16:36:18 +03:00
|
|
|
using AK::human_readable_digital_time;
|
2022-12-10 12:01:10 +03:00
|
|
|
using AK::human_readable_quantity;
|
2020-08-22 21:50:48 +03:00
|
|
|
using AK::human_readable_size;
|
2021-03-24 23:06:08 +03:00
|
|
|
using AK::human_readable_size_long;
|
2022-01-06 00:19:08 +03:00
|
|
|
using AK::human_readable_time;
|
2022-11-26 14:18:30 +03:00
|
|
|
#endif
|